

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>connector Package &mdash; open-hea 0.1 documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="open-hea 0.1 documentation" href="index.html" />
    <link rel="up" title="mysql Package" href="mysql.html" />
    <link rel="prev" title="mysql Package" href="mysql.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="mysql.html" title="mysql Package"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">open-hea 0.1 documentation</a> &raquo;</li>
          <li><a href="mysql.html" accesskey="U">mysql Package</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="connector-package">
<h1>connector Package<a class="headerlink" href="#connector-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<h2><tt class="xref py py-mod docutils literal"><span class="pre">connector</span></tt> Package<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<span class="target" id="module-mysql.connector"></span><p>MySQL Connector/Python - MySQL drive written in Python</p>
<dl class="class">
<dt id="mysql.connector.MySQL">
<em class="property">class </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">MySQL</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#mysql.connector.MySQL" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.mysql.MySQLBase" title="mysql.connector.mysql.MySQLBase"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.mysql.MySQLBase</span></tt></a></p>
<p>Class implementing Python DB API v2.0.</p>
<dl class="method">
<dt id="mysql.connector.MySQL.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.MySQL.close" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.MySQL.commit">
<tt class="descname">commit</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.MySQL.commit" title="Permalink to this definition">¶</a></dt>
<dd><p>Shortcut for executing COMMIT.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.MySQL.connect">
<tt class="descname">connect</tt><big>(</big><em>dsn=''</em>, <em>user=''</em>, <em>password=''</em>, <em>host='127.0.0.1'</em>, <em>port=3306</em>, <em>db=None</em>, <em>database=None</em>, <em>use_unicode=True</em>, <em>charset='utf8'</em>, <em>get_warnings=False</em>, <em>raise_on_warnings=False</em>, <em>autocommit=False</em>, <em>unix_socket=None</em>, <em>connection_timeout=None</em>, <em>client_flags=0</em>, <em>buffered=False</em><big>)</big><a class="headerlink" href="#mysql.connector.MySQL.connect" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Establishes a connection to the MySQL Server. Called also when instansiating</dt>
<dd><p class="first">a new MySQLConnection object through the __init__ method.</p>
<p>Possible parameters are:</p>
<dl class="docutils">
<dt>dsn</dt>
<dd>(not used)</dd>
<dt>user</dt>
<dd>The username used to authenticate with the MySQL Server.</dd>
<dt>password</dt>
<dd>The password to authenticate the user with the MySQL Server.</dd>
<dt>host</dt>
<dd>The hostname or the IP address of the MySQL Server we are connecting with.
(default 127.0.0.1)</dd>
<dt>port</dt>
<dd>TCP port to use for connecting to the MySQL Server.
(default 3306)</dd>
</dl>
<p>database
db</p>
<blockquote>
<div>Initial database to use once we are connected with the MySQL Server.
The db argument is synonym, but database takes precedence.</div></blockquote>
<dl class="last docutils">
<dt>use_unicode</dt>
<dd>If set to true, string values received from MySQL will be returned
as Unicode strings.
Default: True</dd>
<dt>charset</dt>
<dd>Which character shall we use for sending data to MySQL. One can still
override this by using the SET NAMES command directly, but this is
discouraged. Instead, use the set_charset() method if you
want to change it.
Default: Whatever the MySQL server has default.</dd>
<dt>get_warnings</dt>
<dd>If set to true, whenever a query gives a warning, a SHOW WARNINGS will
be done to fetch them. They will be available as MySQLCursor.warnings.
The default is to ignore these warnings, for debugging it&#8217;s good to
enable it though, or use strict mode in MySQL to make most of these
warnings errors.
Default: False</dd>
<dt>raise_on_warnings</dt>
<dd>If set to True, warnings will be raised as exceptions. raise_on_warings
overrides get_warnings.
Default: False</dd>
<dt>autocommit</dt>
<dd>Auto commit is OFF by default, which is required by the Python Db API
2.0 specification.
Default: False</dd>
<dt>unix_socket</dt>
<dd>Full path to the MySQL Server UNIX socket. By default TCP connection will
be used using the address specified by the host argument.</dd>
<dt>connection_timeout</dt>
<dd>Timeout for the TCP and UNIX socket connection.</dd>
<dt>client_flags</dt>
<dd><dl class="first last docutils">
<dt>Allows to set flags for the connection. Check following for possible flags:</dt>
<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">mysql.connector.constants</span> <span class="kn">import</span> <span class="n">ClientFlag</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="s">&#39;</span>
</pre></div>
</div>
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
<p>&#8216;.join(ClientFlag.get_full_info())</p>
<blockquote>
<div><dl class="docutils">
<dt>buffered</dt>
<dd>When set to True .execute() will fetch the rows immediatly.</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.MySQL.cursor">
<tt class="descname">cursor</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.MySQL.cursor" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.MySQL.remove_cursor">
<tt class="descname">remove_cursor</tt><big>(</big><em>c</em><big>)</big><a class="headerlink" href="#mysql.connector.MySQL.remove_cursor" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.MySQL.rollback">
<tt class="descname">rollback</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.MySQL.rollback" title="Permalink to this definition">¶</a></dt>
<dd><p>Shortcut for executing ROLLBACK</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="mysql.connector.Connect">
<tt class="descclassname">mysql.connector.</tt><tt class="descname">Connect</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#mysql.connector.Connect" title="Permalink to this definition">¶</a></dt>
<dd><p>Shortcut for creating a mysql.MySQL object.</p>
</dd></dl>

<dl class="class">
<dt id="mysql.connector.FieldType">
<em class="property">class </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">FieldType</tt><a class="headerlink" href="#mysql.connector.FieldType" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constants</span></tt></p>
<dl class="attribute">
<dt id="mysql.connector.FieldType.BIT">
<tt class="descname">BIT</tt><em class="property"> = 16</em><a class="headerlink" href="#mysql.connector.FieldType.BIT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.BLOB">
<tt class="descname">BLOB</tt><em class="property"> = 252</em><a class="headerlink" href="#mysql.connector.FieldType.BLOB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.DATE">
<tt class="descname">DATE</tt><em class="property"> = 10</em><a class="headerlink" href="#mysql.connector.FieldType.DATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.DATETIME">
<tt class="descname">DATETIME</tt><em class="property"> = 12</em><a class="headerlink" href="#mysql.connector.FieldType.DATETIME" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.DECIMAL">
<tt class="descname">DECIMAL</tt><em class="property"> = 0</em><a class="headerlink" href="#mysql.connector.FieldType.DECIMAL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.DOUBLE">
<tt class="descname">DOUBLE</tt><em class="property"> = 5</em><a class="headerlink" href="#mysql.connector.FieldType.DOUBLE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.ENUM">
<tt class="descname">ENUM</tt><em class="property"> = 247</em><a class="headerlink" href="#mysql.connector.FieldType.ENUM" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.FLOAT">
<tt class="descname">FLOAT</tt><em class="property"> = 4</em><a class="headerlink" href="#mysql.connector.FieldType.FLOAT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.GEOMETRY">
<tt class="descname">GEOMETRY</tt><em class="property"> = 255</em><a class="headerlink" href="#mysql.connector.FieldType.GEOMETRY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.INT24">
<tt class="descname">INT24</tt><em class="property"> = 9</em><a class="headerlink" href="#mysql.connector.FieldType.INT24" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.LONG">
<tt class="descname">LONG</tt><em class="property"> = 3</em><a class="headerlink" href="#mysql.connector.FieldType.LONG" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.LONGLONG">
<tt class="descname">LONGLONG</tt><em class="property"> = 8</em><a class="headerlink" href="#mysql.connector.FieldType.LONGLONG" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.LONG_BLOB">
<tt class="descname">LONG_BLOB</tt><em class="property"> = 251</em><a class="headerlink" href="#mysql.connector.FieldType.LONG_BLOB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.MEDIUM_BLOB">
<tt class="descname">MEDIUM_BLOB</tt><em class="property"> = 250</em><a class="headerlink" href="#mysql.connector.FieldType.MEDIUM_BLOB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.NEWDATE">
<tt class="descname">NEWDATE</tt><em class="property"> = 14</em><a class="headerlink" href="#mysql.connector.FieldType.NEWDATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.NEWDECIMAL">
<tt class="descname">NEWDECIMAL</tt><em class="property"> = 246</em><a class="headerlink" href="#mysql.connector.FieldType.NEWDECIMAL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.NULL">
<tt class="descname">NULL</tt><em class="property"> = 6</em><a class="headerlink" href="#mysql.connector.FieldType.NULL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.SET">
<tt class="descname">SET</tt><em class="property"> = 248</em><a class="headerlink" href="#mysql.connector.FieldType.SET" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.SHORT">
<tt class="descname">SHORT</tt><em class="property"> = 2</em><a class="headerlink" href="#mysql.connector.FieldType.SHORT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.STRING">
<tt class="descname">STRING</tt><em class="property"> = 254</em><a class="headerlink" href="#mysql.connector.FieldType.STRING" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.TIME">
<tt class="descname">TIME</tt><em class="property"> = 11</em><a class="headerlink" href="#mysql.connector.FieldType.TIME" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.TIMESTAMP">
<tt class="descname">TIMESTAMP</tt><em class="property"> = 7</em><a class="headerlink" href="#mysql.connector.FieldType.TIMESTAMP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.TINY">
<tt class="descname">TINY</tt><em class="property"> = 1</em><a class="headerlink" href="#mysql.connector.FieldType.TINY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.TINY_BLOB">
<tt class="descname">TINY_BLOB</tt><em class="property"> = 249</em><a class="headerlink" href="#mysql.connector.FieldType.TINY_BLOB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.VARCHAR">
<tt class="descname">VARCHAR</tt><em class="property"> = 15</em><a class="headerlink" href="#mysql.connector.FieldType.VARCHAR" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.VAR_STRING">
<tt class="descname">VAR_STRING</tt><em class="property"> = 253</em><a class="headerlink" href="#mysql.connector.FieldType.VAR_STRING" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.YEAR">
<tt class="descname">YEAR</tt><em class="property"> = 13</em><a class="headerlink" href="#mysql.connector.FieldType.YEAR" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.desc">
<tt class="descname">desc</tt><em class="property"> = {'LONGLONG': (8, 'LONGLONG'), 'SHORT': (2, 'SHORT'), 'LONG': (3, 'LONG'), 'DATE': (10, 'DATE'), 'NEWDATE': (14, 'NEWDATE'), 'NULL': (6, 'NULL'), 'TIMESTAMP': (7, 'TIMESTAMP'), 'SET': (248, 'SET'), 'VARCHAR': (15, 'VARCHAR'), 'TINY': (1, 'TINY'), 'NEWDECIMAL': (246, 'NEWDECIMAL'), 'BIT': (16, 'BIT'), 'MEDIUM_BLOB': (250, 'MEDIUM_BLOB'), 'VAR_STRING': (253, 'VAR_STRING'), 'STRING': (254, 'STRING'), 'DECIMAL': (0, 'DECIMAL'), 'ENUM': (247, 'ENUM'), 'TINY_BLOB': (249, 'TINY_BLOB'), 'DATETIME': (12, 'DATETIME'), 'YEAR': (13, 'YEAR'), 'INT24': (9, 'INT24'), 'DOUBLE': (5, 'DOUBLE'), 'FLOAT': (4, 'FLOAT'), 'GEOMETRY': (255, 'GEOMETRY'), 'BLOB': (252, 'BLOB'), 'TIME': (11, 'TIME'), 'LONG_BLOB': (251, 'LONG_BLOB')}</em><a class="headerlink" href="#mysql.connector.FieldType.desc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.FieldType.get_binary_types">
<em class="property">classmethod </em><tt class="descname">get_binary_types</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.FieldType.get_binary_types" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.FieldType.get_number_types">
<em class="property">classmethod </em><tt class="descname">get_number_types</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.FieldType.get_number_types" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.FieldType.get_string_types">
<em class="property">classmethod </em><tt class="descname">get_string_types</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.FieldType.get_string_types" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.FieldType.get_timestamp_types">
<em class="property">classmethod </em><tt class="descname">get_timestamp_types</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.FieldType.get_timestamp_types" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldType.prefix">
<tt class="descname">prefix</tt><em class="property"> = 'FIELD_TYPE_'</em><a class="headerlink" href="#mysql.connector.FieldType.prefix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.FieldFlag">
<em class="property">class </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">FieldFlag</tt><a class="headerlink" href="#mysql.connector.FieldFlag" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constantflags</span></tt></p>
<p>Field flags as found in MySQL sources mysql-src/include/mysql_com.h</p>
<dl class="attribute">
<dt id="mysql.connector.FieldFlag.AUTO_INCREMENT">
<tt class="descname">AUTO_INCREMENT</tt><em class="property"> = 512</em><a class="headerlink" href="#mysql.connector.FieldFlag.AUTO_INCREMENT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.BINARY">
<tt class="descname">BINARY</tt><em class="property"> = 128</em><a class="headerlink" href="#mysql.connector.FieldFlag.BINARY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.BINCMP">
<tt class="descname">BINCMP</tt><em class="property"> = 131072</em><a class="headerlink" href="#mysql.connector.FieldFlag.BINCMP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.BLOB">
<tt class="descname">BLOB</tt><em class="property"> = 16</em><a class="headerlink" href="#mysql.connector.FieldFlag.BLOB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.ENUM">
<tt class="descname">ENUM</tt><em class="property"> = 256</em><a class="headerlink" href="#mysql.connector.FieldFlag.ENUM" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.FIELD_IN_ADD_INDEX">
<tt class="descname">FIELD_IN_ADD_INDEX</tt><em class="property"> = 1048576</em><a class="headerlink" href="#mysql.connector.FieldFlag.FIELD_IN_ADD_INDEX" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.FIELD_IN_PART_FUNC">
<tt class="descname">FIELD_IN_PART_FUNC</tt><em class="property"> = 524288</em><a class="headerlink" href="#mysql.connector.FieldFlag.FIELD_IN_PART_FUNC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.FIELD_IS_RENAMED">
<tt class="descname">FIELD_IS_RENAMED</tt><em class="property"> = 2097152</em><a class="headerlink" href="#mysql.connector.FieldFlag.FIELD_IS_RENAMED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.GET_FIXED_FIELDS">
<tt class="descname">GET_FIXED_FIELDS</tt><em class="property"> = 262144</em><a class="headerlink" href="#mysql.connector.FieldFlag.GET_FIXED_FIELDS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.GROUP">
<tt class="descname">GROUP</tt><em class="property"> = 16384</em><a class="headerlink" href="#mysql.connector.FieldFlag.GROUP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.MULTIPLE_KEY">
<tt class="descname">MULTIPLE_KEY</tt><em class="property"> = 8</em><a class="headerlink" href="#mysql.connector.FieldFlag.MULTIPLE_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.NOT_NULL">
<tt class="descname">NOT_NULL</tt><em class="property"> = 1</em><a class="headerlink" href="#mysql.connector.FieldFlag.NOT_NULL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.NO_DEFAULT_VALUE">
<tt class="descname">NO_DEFAULT_VALUE</tt><em class="property"> = 4096</em><a class="headerlink" href="#mysql.connector.FieldFlag.NO_DEFAULT_VALUE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.NUM">
<tt class="descname">NUM</tt><em class="property"> = 16384</em><a class="headerlink" href="#mysql.connector.FieldFlag.NUM" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.ON_UPDATE_NOW">
<tt class="descname">ON_UPDATE_NOW</tt><em class="property"> = 8192</em><a class="headerlink" href="#mysql.connector.FieldFlag.ON_UPDATE_NOW" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.PART_KEY">
<tt class="descname">PART_KEY</tt><em class="property"> = 32768</em><a class="headerlink" href="#mysql.connector.FieldFlag.PART_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.PRI_KEY">
<tt class="descname">PRI_KEY</tt><em class="property"> = 2</em><a class="headerlink" href="#mysql.connector.FieldFlag.PRI_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.SET">
<tt class="descname">SET</tt><em class="property"> = 2048</em><a class="headerlink" href="#mysql.connector.FieldFlag.SET" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.TIMESTAMP">
<tt class="descname">TIMESTAMP</tt><em class="property"> = 1024</em><a class="headerlink" href="#mysql.connector.FieldFlag.TIMESTAMP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.UNIQUE">
<tt class="descname">UNIQUE</tt><em class="property"> = 65536</em><a class="headerlink" href="#mysql.connector.FieldFlag.UNIQUE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.UNIQUE_KEY">
<tt class="descname">UNIQUE_KEY</tt><em class="property"> = 4</em><a class="headerlink" href="#mysql.connector.FieldFlag.UNIQUE_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.UNSIGNED">
<tt class="descname">UNSIGNED</tt><em class="property"> = 32</em><a class="headerlink" href="#mysql.connector.FieldFlag.UNSIGNED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.ZEROFILL">
<tt class="descname">ZEROFILL</tt><em class="property"> = 64</em><a class="headerlink" href="#mysql.connector.FieldFlag.ZEROFILL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.FieldFlag.desc">
<tt class="descname">desc</tt><em class="property"> = {'GROUP': (16384, 'Intern: Group field'), 'FIELD_IN_PART_FUNC': (524288, 'Field part of partition func'), 'PRI_KEY': (2, 'Field is part of a primary key'), 'NO_DEFAULT_VALUE': (4096, &quot;Field doesn't have default value&quot;), 'PART_KEY': (32768, 'Intern; Part of some key'), 'NOT_NULL': (1, &quot;Field can't be NULL&quot;), 'MULTIPLE_KEY': (8, 'Field is part of a key'), 'SET': (2048, 'field is a set'), 'UNIQUE_KEY': (4, 'Field is part of a unique key'), 'AUTO_INCREMENT': (512, 'field is a autoincrement field'), 'UNSIGNED': (32, 'Field is unsigned'), 'GET_FIXED_FIELDS': (262144, 'Used to get fields in item tree'), 'NUM': (16384, 'Field is num (for clients)'), 'FIELD_IN_ADD_INDEX': (1048576, 'Intern: Field used in ADD INDEX'), 'ZEROFILL': (64, 'Field is zerofill'), 'ON_UPDATE_NOW': (8192, 'Field is set to NOW on UPDATE'), 'ENUM': (256, 'field is an enum'), 'BINCMP': (131072, 'Intern: Used by sql_yacc'), 'FIELD_IS_RENAMED': (2097152, 'Intern: Field is being renamed'), 'UNIQUE': (65536, 'Intern: Used by sql_yacc'), 'BINARY': (128, 'Field is binary  '), 'TIMESTAMP': (1024, 'Field is a timestamp'), 'BLOB': (16, 'Field is a blob')}</em><a class="headerlink" href="#mysql.connector.FieldFlag.desc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.ClientFlag">
<em class="property">class </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">ClientFlag</tt><a class="headerlink" href="#mysql.connector.ClientFlag" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constantflags</span></tt></p>
<p>Client Options as found in the MySQL sources mysql-src/include/mysql_com.h</p>
<dl class="attribute">
<dt id="mysql.connector.ClientFlag.COMPRESS">
<tt class="descname">COMPRESS</tt><em class="property"> = 32</em><a class="headerlink" href="#mysql.connector.ClientFlag.COMPRESS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.CONNECT_WITH_DB">
<tt class="descname">CONNECT_WITH_DB</tt><em class="property"> = 8</em><a class="headerlink" href="#mysql.connector.ClientFlag.CONNECT_WITH_DB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.FOUND_ROWS">
<tt class="descname">FOUND_ROWS</tt><em class="property"> = 2</em><a class="headerlink" href="#mysql.connector.ClientFlag.FOUND_ROWS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.IGNORE_SIGPIPE">
<tt class="descname">IGNORE_SIGPIPE</tt><em class="property"> = 4096</em><a class="headerlink" href="#mysql.connector.ClientFlag.IGNORE_SIGPIPE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.IGNORE_SPACE">
<tt class="descname">IGNORE_SPACE</tt><em class="property"> = 256</em><a class="headerlink" href="#mysql.connector.ClientFlag.IGNORE_SPACE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.INTERACTIVE">
<tt class="descname">INTERACTIVE</tt><em class="property"> = 1024</em><a class="headerlink" href="#mysql.connector.ClientFlag.INTERACTIVE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.LOCAL_FILES">
<tt class="descname">LOCAL_FILES</tt><em class="property"> = 128</em><a class="headerlink" href="#mysql.connector.ClientFlag.LOCAL_FILES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.LONG_FLAG">
<tt class="descname">LONG_FLAG</tt><em class="property"> = 4</em><a class="headerlink" href="#mysql.connector.ClientFlag.LONG_FLAG" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.LONG_PASSWD">
<tt class="descname">LONG_PASSWD</tt><em class="property"> = 1</em><a class="headerlink" href="#mysql.connector.ClientFlag.LONG_PASSWD" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.MULTI_RESULTS">
<tt class="descname">MULTI_RESULTS</tt><em class="property"> = 131072</em><a class="headerlink" href="#mysql.connector.ClientFlag.MULTI_RESULTS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.MULTI_STATEMENTS">
<tt class="descname">MULTI_STATEMENTS</tt><em class="property"> = 65536</em><a class="headerlink" href="#mysql.connector.ClientFlag.MULTI_STATEMENTS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.NO_SCHEMA">
<tt class="descname">NO_SCHEMA</tt><em class="property"> = 16</em><a class="headerlink" href="#mysql.connector.ClientFlag.NO_SCHEMA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.ODBC">
<tt class="descname">ODBC</tt><em class="property"> = 64</em><a class="headerlink" href="#mysql.connector.ClientFlag.ODBC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.PROTOCOL_41">
<tt class="descname">PROTOCOL_41</tt><em class="property"> = 512</em><a class="headerlink" href="#mysql.connector.ClientFlag.PROTOCOL_41" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.REMEMBER_OPTIONS">
<tt class="descname">REMEMBER_OPTIONS</tt><em class="property"> = 2147483648L</em><a class="headerlink" href="#mysql.connector.ClientFlag.REMEMBER_OPTIONS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.RESERVED">
<tt class="descname">RESERVED</tt><em class="property"> = 16384</em><a class="headerlink" href="#mysql.connector.ClientFlag.RESERVED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.SECURE_CONNECTION">
<tt class="descname">SECURE_CONNECTION</tt><em class="property"> = 32768</em><a class="headerlink" href="#mysql.connector.ClientFlag.SECURE_CONNECTION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.SSL">
<tt class="descname">SSL</tt><em class="property"> = 2048</em><a class="headerlink" href="#mysql.connector.ClientFlag.SSL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.SSL_VERIFY_SERVER_CERT">
<tt class="descname">SSL_VERIFY_SERVER_CERT</tt><em class="property"> = 1073741824</em><a class="headerlink" href="#mysql.connector.ClientFlag.SSL_VERIFY_SERVER_CERT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.TRANSACTIONS">
<tt class="descname">TRANSACTIONS</tt><em class="property"> = 8192</em><a class="headerlink" href="#mysql.connector.ClientFlag.TRANSACTIONS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.default">
<tt class="descname">default</tt><em class="property"> = [1, 4, 8, 512, 8192, 32768, 65536, 131072]</em><a class="headerlink" href="#mysql.connector.ClientFlag.default" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.ClientFlag.desc">
<tt class="descname">desc</tt><em class="property"> = {'NO_SCHEMA': (16, &quot;Don't allow database.table.column&quot;), 'IGNORE_SIGPIPE': (4096, 'IGNORE sigpipes'), 'SECURE_CONNECTION': (32768, 'New 4.1 authentication'), 'RESERVED': (16384, 'Old flag for 4.1 protocol'), 'FOUND_ROWS': (2, 'Found instead of affected rows'), 'TRANSACTIONS': (8192, 'Client knows about transactions'), 'ODBC': (64, 'ODBC client'), 'SSL_VERIFY_SERVER_CERT': (1073741824, ''), 'COMPRESS': (32, 'Can use compression protocol'), 'CONNECT_WITH_DB': (8, 'One can specify db on connect'), 'REMEMBER_OPTIONS': (2147483648L, ''), 'SSL': (2048, 'Switch to SSL after handshake'), 'LOCAL_FILES': (128, 'Can use LOAD DATA LOCAL'), 'PROTOCOL_41': (512, 'New 4.1 protocol'), 'LONG_FLAG': (4, 'Get all column flags'), 'MULTI_RESULTS': (131072, 'Enable/disable multi-results'), 'MULTI_STATEMENTS': (65536, 'Enable/disable multi-stmt support'), 'LONG_PASSWD': (1, 'New more secure passwords'), 'IGNORE_SPACE': (256, &quot;Ignore spaces before ''&quot;), 'INTERACTIVE': (1024, 'This is an interactive client')}</em><a class="headerlink" href="#mysql.connector.ClientFlag.desc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.ClientFlag.get_default">
<em class="property">classmethod </em><tt class="descname">get_default</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.ClientFlag.get_default" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.CharacterSet">
<em class="property">class </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">CharacterSet</tt><a class="headerlink" href="#mysql.connector.CharacterSet" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constants</span></tt></p>
<p>List of supported character sets with their collations. This maps to the
character set we get from the server within the handshake packet.</p>
<dl class="docutils">
<dt>To update this list, use the following query:</dt>
<dd><dl class="first last docutils">
<dt>SELECT ID,CHARACTER_SET_NAME, COLLATION_NAME</dt>
<dd>FROM INFORMATION_SCHEMA.COLLATIONS
ORDER BY ID</dd>
</dl>
</dd>
</dl>
<p>This list is hardcoded because we want to avoid doing each time the above
query to get the name of the character set used.</p>
<dl class="classmethod">
<dt id="mysql.connector.CharacterSet.get_charset_info">
<em class="property">classmethod </em><tt class="descname">get_charset_info</tt><big>(</big><em>name</em>, <em>collation=None</em><big>)</big><a class="headerlink" href="#mysql.connector.CharacterSet.get_charset_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns information about the charset and optional collation.</p>
</dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.CharacterSet.get_desc">
<em class="property">classmethod </em><tt class="descname">get_desc</tt><big>(</big><em>setid</em><big>)</big><a class="headerlink" href="#mysql.connector.CharacterSet.get_desc" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns info string about the charset for given MySQL ID.</p>
</dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.CharacterSet.get_info">
<em class="property">classmethod </em><tt class="descname">get_info</tt><big>(</big><em>setid</em><big>)</big><a class="headerlink" href="#mysql.connector.CharacterSet.get_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns information about the charset for given MySQL ID.</p>
</dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.CharacterSet.get_supported">
<em class="property">classmethod </em><tt class="descname">get_supported</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.CharacterSet.get_supported" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list with names of all supproted character sets.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.RefreshOption">
<em class="property">class </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">RefreshOption</tt><a class="headerlink" href="#mysql.connector.RefreshOption" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constants</span></tt></p>
<p>Options used when sending the COM_REFRESH server command.</p>
<dl class="attribute">
<dt id="mysql.connector.RefreshOption.GRANT">
<tt class="descname">GRANT</tt><em class="property"> = 1</em><a class="headerlink" href="#mysql.connector.RefreshOption.GRANT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.RefreshOption.HOST">
<tt class="descname">HOST</tt><em class="property"> = 8</em><a class="headerlink" href="#mysql.connector.RefreshOption.HOST" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.RefreshOption.LOG">
<tt class="descname">LOG</tt><em class="property"> = 2</em><a class="headerlink" href="#mysql.connector.RefreshOption.LOG" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.RefreshOption.SLAVE">
<tt class="descname">SLAVE</tt><em class="property"> = 64</em><a class="headerlink" href="#mysql.connector.RefreshOption.SLAVE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.RefreshOption.STATUS">
<tt class="descname">STATUS</tt><em class="property"> = 16</em><a class="headerlink" href="#mysql.connector.RefreshOption.STATUS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.RefreshOption.TABLES">
<tt class="descname">TABLES</tt><em class="property"> = 4</em><a class="headerlink" href="#mysql.connector.RefreshOption.TABLES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.RefreshOption.THREADS">
<tt class="descname">THREADS</tt><em class="property"> = 32</em><a class="headerlink" href="#mysql.connector.RefreshOption.THREADS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.RefreshOption.desc">
<tt class="descname">desc</tt><em class="property"> = {'STATUS': (16, 'Flush status variables'), 'TABLES': (4, 'close all tables'), 'SLAVE': (64, 'Reset master info and restart slave thread'), 'LOG': (2, 'Start on new log file'), 'GRANT': (1, 'Refresh grant tables'), 'THREADS': (32, 'Flush thread cache'), 'HOSTS': (8, 'Flush host cache')}</em><a class="headerlink" href="#mysql.connector.RefreshOption.desc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="exception">
<dt id="mysql.connector.Error">
<em class="property">exception </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">Error</tt><big>(</big><em>m</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.Error" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.StandardError</span></tt></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.Warning">
<em class="property">exception </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">Warning</tt><a class="headerlink" href="#mysql.connector.Warning" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.StandardError</span></tt></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.InterfaceError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">InterfaceError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.InterfaceError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.Error" title="mysql.connector.errors.Error"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.Error</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.DatabaseError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">DatabaseError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.DatabaseError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.Error" title="mysql.connector.errors.Error"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.Error</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.NotSupportedError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">NotSupportedError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.NotSupportedError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.DataError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">DataError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.DataError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.IntegrityError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">IntegrityError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.IntegrityError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.ProgrammingError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">ProgrammingError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.ProgrammingError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.OperationalError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">OperationalError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.OperationalError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.InternalError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.</tt><tt class="descname">InternalError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.InternalError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.connect">
<tt class="descclassname">mysql.connector.</tt><tt class="descname">connect</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#mysql.connector.connect" title="Permalink to this definition">¶</a></dt>
<dd><p>Shortcut for creating a mysql.MySQL object.</p>
</dd></dl>

<dl class="attribute">
<dt id="mysql.connector.Date">
<tt class="descclassname">mysql.connector.</tt><tt class="descname">Date</tt><a class="headerlink" href="#mysql.connector.Date" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">date</span></tt></p>
</dd></dl>

<dl class="attribute">
<dt id="mysql.connector.Time">
<tt class="descclassname">mysql.connector.</tt><tt class="descname">Time</tt><a class="headerlink" href="#mysql.connector.Time" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">time</span></tt></p>
</dd></dl>

<dl class="attribute">
<dt id="mysql.connector.Timestamp">
<tt class="descclassname">mysql.connector.</tt><tt class="descname">Timestamp</tt><a class="headerlink" href="#mysql.connector.Timestamp" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">datetime</span></tt></p>
</dd></dl>

<dl class="attribute">
<dt id="mysql.connector.Binary">
<tt class="descclassname">mysql.connector.</tt><tt class="descname">Binary</tt><a class="headerlink" href="#mysql.connector.Binary" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.DateFromTicks">
<tt class="descclassname">mysql.connector.</tt><tt class="descname">DateFromTicks</tt><big>(</big><em>ticks</em><big>)</big><a class="headerlink" href="#mysql.connector.DateFromTicks" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<tt class="descclassname">mysql.connector.</tt><tt class="descname">DateFromTicks</tt><big>(</big><em>ticks</em><big>)</big></dt>
<dd></dd></dl>

<dl class="function">
<dt id="mysql.connector.TimestampFromTicks">
<tt class="descclassname">mysql.connector.</tt><tt class="descname">TimestampFromTicks</tt><big>(</big><em>ticks</em><big>)</big><a class="headerlink" href="#mysql.connector.TimestampFromTicks" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-mysql.connector._version">
<span id="version-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">_version</span></tt> Module<a class="headerlink" href="#module-mysql.connector._version" title="Permalink to this headline">¶</a></h2>
<p>Holds version of MySQL Connector/Python</p>
</div>
<div class="section" id="module-mysql.connector.connection">
<span id="connection-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">connection</span></tt> Module<a class="headerlink" href="#module-mysql.connector.connection" title="Permalink to this headline">¶</a></h2>
<p>Implementing communication to MySQL servers</p>
<dl class="class">
<dt id="mysql.connector.connection.MySQLBaseConnection">
<em class="property">class </em><tt class="descclassname">mysql.connector.connection.</tt><tt class="descname">MySQLBaseConnection</tt><big>(</big><em>prtcls=None</em><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLBaseConnection" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>Base class for MySQL Connections subclasses.</p>
<p>Should not be used directly but overloaded, changing the
open_connection part. Examples over subclasses are</p>
<blockquote>
<div>MySQLTCPConnection
MySQLUNIXConnection</div></blockquote>
<dl class="method">
<dt id="mysql.connector.connection.MySQLBaseConnection.close_connection">
<tt class="descname">close_connection</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLBaseConnection.close_connection" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.connection.MySQLBaseConnection.do_handshake">
<tt class="descname">do_handshake</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLBaseConnection.do_handshake" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.connection.MySQLBaseConnection.get_address">
<tt class="descname">get_address</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLBaseConnection.get_address" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.connection.MySQLBaseConnection.open_connection">
<tt class="descname">open_connection</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLBaseConnection.open_connection" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.connection.MySQLBaseConnection.recv">
<tt class="descname">recv</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLBaseConnection.recv" title="Permalink to this definition">¶</a></dt>
<dd><p>Receive packets using the socket from the server.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.connection.MySQLBaseConnection.send">
<tt class="descname">send</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLBaseConnection.send" title="Permalink to this definition">¶</a></dt>
<dd><p>Send packets using the socket to the server.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.connection.MySQLBaseConnection.set_connection_timeout">
<tt class="descname">set_connection_timeout</tt><big>(</big><em>timeout</em><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLBaseConnection.set_connection_timeout" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.connection.MySQLBaseConnection.set_protocol">
<tt class="descname">set_protocol</tt><big>(</big><em>prtcls</em><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLBaseConnection.set_protocol" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.connection.MySQLTCPConnection">
<em class="property">class </em><tt class="descclassname">mysql.connector.connection.</tt><tt class="descname">MySQLTCPConnection</tt><big>(</big><em>prtcls=None</em>, <em>host='127.0.0.1'</em>, <em>port=3306</em><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLTCPConnection" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.connection.MySQLBaseConnection" title="mysql.connector.connection.MySQLBaseConnection"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.connection.MySQLBaseConnection</span></tt></a></p>
<p>Opens a TCP connection to the MySQL Server.</p>
<dl class="method">
<dt id="mysql.connector.connection.MySQLTCPConnection.get_address">
<tt class="descname">get_address</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLTCPConnection.get_address" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.connection.MySQLTCPConnection.open_connection">
<tt class="descname">open_connection</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLTCPConnection.open_connection" title="Permalink to this definition">¶</a></dt>
<dd><p>Opens a TCP Connection and checks the MySQL handshake.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.connection.MySQLUnixConnection">
<em class="property">class </em><tt class="descclassname">mysql.connector.connection.</tt><tt class="descname">MySQLUnixConnection</tt><big>(</big><em>prtcls=None</em>, <em>unix_socket='/tmp/mysql.sock'</em><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLUnixConnection" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.connection.MySQLBaseConnection" title="mysql.connector.connection.MySQLBaseConnection"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.connection.MySQLBaseConnection</span></tt></a></p>
<p>Opens a connection through the UNIX socket of the MySQL Server.</p>
<dl class="method">
<dt id="mysql.connector.connection.MySQLUnixConnection.get_address">
<tt class="descname">get_address</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLUnixConnection.get_address" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.connection.MySQLUnixConnection.open_connection">
<tt class="descname">open_connection</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.connection.MySQLUnixConnection.open_connection" title="Permalink to this definition">¶</a></dt>
<dd><p>Opens a UNIX socket and checks the MySQL handshake.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-mysql.connector.constants">
<span id="constants-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">constants</span></tt> Module<a class="headerlink" href="#module-mysql.connector.constants" title="Permalink to this headline">¶</a></h2>
<p>Various MySQL constants and character sets</p>
<dl class="class">
<dt id="mysql.connector.constants.CharacterSet">
<em class="property">class </em><tt class="descclassname">mysql.connector.constants.</tt><tt class="descname">CharacterSet</tt><a class="headerlink" href="#mysql.connector.constants.CharacterSet" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constants</span></tt></p>
<p>List of supported character sets with their collations. This maps to the
character set we get from the server within the handshake packet.</p>
<dl class="docutils">
<dt>To update this list, use the following query:</dt>
<dd><dl class="first last docutils">
<dt>SELECT ID,CHARACTER_SET_NAME, COLLATION_NAME</dt>
<dd>FROM INFORMATION_SCHEMA.COLLATIONS
ORDER BY ID</dd>
</dl>
</dd>
</dl>
<p>This list is hardcoded because we want to avoid doing each time the above
query to get the name of the character set used.</p>
<dl class="classmethod">
<dt id="mysql.connector.constants.CharacterSet.get_charset_info">
<em class="property">classmethod </em><tt class="descname">get_charset_info</tt><big>(</big><em>name</em>, <em>collation=None</em><big>)</big><a class="headerlink" href="#mysql.connector.constants.CharacterSet.get_charset_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns information about the charset and optional collation.</p>
</dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.constants.CharacterSet.get_desc">
<em class="property">classmethod </em><tt class="descname">get_desc</tt><big>(</big><em>setid</em><big>)</big><a class="headerlink" href="#mysql.connector.constants.CharacterSet.get_desc" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns info string about the charset for given MySQL ID.</p>
</dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.constants.CharacterSet.get_info">
<em class="property">classmethod </em><tt class="descname">get_info</tt><big>(</big><em>setid</em><big>)</big><a class="headerlink" href="#mysql.connector.constants.CharacterSet.get_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns information about the charset for given MySQL ID.</p>
</dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.constants.CharacterSet.get_supported">
<em class="property">classmethod </em><tt class="descname">get_supported</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.constants.CharacterSet.get_supported" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list with names of all supproted character sets.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.constants.ClientFlag">
<em class="property">class </em><tt class="descclassname">mysql.connector.constants.</tt><tt class="descname">ClientFlag</tt><a class="headerlink" href="#mysql.connector.constants.ClientFlag" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constantflags</span></tt></p>
<p>Client Options as found in the MySQL sources mysql-src/include/mysql_com.h</p>
<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.COMPRESS">
<tt class="descname">COMPRESS</tt><em class="property"> = 32</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.COMPRESS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.CONNECT_WITH_DB">
<tt class="descname">CONNECT_WITH_DB</tt><em class="property"> = 8</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.CONNECT_WITH_DB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.FOUND_ROWS">
<tt class="descname">FOUND_ROWS</tt><em class="property"> = 2</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.FOUND_ROWS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.IGNORE_SIGPIPE">
<tt class="descname">IGNORE_SIGPIPE</tt><em class="property"> = 4096</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.IGNORE_SIGPIPE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.IGNORE_SPACE">
<tt class="descname">IGNORE_SPACE</tt><em class="property"> = 256</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.IGNORE_SPACE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.INTERACTIVE">
<tt class="descname">INTERACTIVE</tt><em class="property"> = 1024</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.INTERACTIVE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.LOCAL_FILES">
<tt class="descname">LOCAL_FILES</tt><em class="property"> = 128</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.LOCAL_FILES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.LONG_FLAG">
<tt class="descname">LONG_FLAG</tt><em class="property"> = 4</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.LONG_FLAG" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.LONG_PASSWD">
<tt class="descname">LONG_PASSWD</tt><em class="property"> = 1</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.LONG_PASSWD" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.MULTI_RESULTS">
<tt class="descname">MULTI_RESULTS</tt><em class="property"> = 131072</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.MULTI_RESULTS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.MULTI_STATEMENTS">
<tt class="descname">MULTI_STATEMENTS</tt><em class="property"> = 65536</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.MULTI_STATEMENTS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.NO_SCHEMA">
<tt class="descname">NO_SCHEMA</tt><em class="property"> = 16</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.NO_SCHEMA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.ODBC">
<tt class="descname">ODBC</tt><em class="property"> = 64</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.ODBC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.PROTOCOL_41">
<tt class="descname">PROTOCOL_41</tt><em class="property"> = 512</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.PROTOCOL_41" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.REMEMBER_OPTIONS">
<tt class="descname">REMEMBER_OPTIONS</tt><em class="property"> = 2147483648L</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.REMEMBER_OPTIONS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.RESERVED">
<tt class="descname">RESERVED</tt><em class="property"> = 16384</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.RESERVED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.SECURE_CONNECTION">
<tt class="descname">SECURE_CONNECTION</tt><em class="property"> = 32768</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.SECURE_CONNECTION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.SSL">
<tt class="descname">SSL</tt><em class="property"> = 2048</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.SSL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.SSL_VERIFY_SERVER_CERT">
<tt class="descname">SSL_VERIFY_SERVER_CERT</tt><em class="property"> = 1073741824</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.SSL_VERIFY_SERVER_CERT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.TRANSACTIONS">
<tt class="descname">TRANSACTIONS</tt><em class="property"> = 8192</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.TRANSACTIONS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.default">
<tt class="descname">default</tt><em class="property"> = [1, 4, 8, 512, 8192, 32768, 65536, 131072]</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.default" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ClientFlag.desc">
<tt class="descname">desc</tt><em class="property"> = {'NO_SCHEMA': (16, &quot;Don't allow database.table.column&quot;), 'IGNORE_SIGPIPE': (4096, 'IGNORE sigpipes'), 'SECURE_CONNECTION': (32768, 'New 4.1 authentication'), 'RESERVED': (16384, 'Old flag for 4.1 protocol'), 'FOUND_ROWS': (2, 'Found instead of affected rows'), 'TRANSACTIONS': (8192, 'Client knows about transactions'), 'ODBC': (64, 'ODBC client'), 'SSL_VERIFY_SERVER_CERT': (1073741824, ''), 'COMPRESS': (32, 'Can use compression protocol'), 'CONNECT_WITH_DB': (8, 'One can specify db on connect'), 'REMEMBER_OPTIONS': (2147483648L, ''), 'SSL': (2048, 'Switch to SSL after handshake'), 'LOCAL_FILES': (128, 'Can use LOAD DATA LOCAL'), 'PROTOCOL_41': (512, 'New 4.1 protocol'), 'LONG_FLAG': (4, 'Get all column flags'), 'MULTI_RESULTS': (131072, 'Enable/disable multi-results'), 'MULTI_STATEMENTS': (65536, 'Enable/disable multi-stmt support'), 'LONG_PASSWD': (1, 'New more secure passwords'), 'IGNORE_SPACE': (256, &quot;Ignore spaces before ''&quot;), 'INTERACTIVE': (1024, 'This is an interactive client')}</em><a class="headerlink" href="#mysql.connector.constants.ClientFlag.desc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.constants.ClientFlag.get_default">
<em class="property">classmethod </em><tt class="descname">get_default</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.constants.ClientFlag.get_default" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.constants.FieldFlag">
<em class="property">class </em><tt class="descclassname">mysql.connector.constants.</tt><tt class="descname">FieldFlag</tt><a class="headerlink" href="#mysql.connector.constants.FieldFlag" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constantflags</span></tt></p>
<p>Field flags as found in MySQL sources mysql-src/include/mysql_com.h</p>
<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.AUTO_INCREMENT">
<tt class="descname">AUTO_INCREMENT</tt><em class="property"> = 512</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.AUTO_INCREMENT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.BINARY">
<tt class="descname">BINARY</tt><em class="property"> = 128</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.BINARY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.BINCMP">
<tt class="descname">BINCMP</tt><em class="property"> = 131072</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.BINCMP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.BLOB">
<tt class="descname">BLOB</tt><em class="property"> = 16</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.BLOB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.ENUM">
<tt class="descname">ENUM</tt><em class="property"> = 256</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.ENUM" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.FIELD_IN_ADD_INDEX">
<tt class="descname">FIELD_IN_ADD_INDEX</tt><em class="property"> = 1048576</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.FIELD_IN_ADD_INDEX" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.FIELD_IN_PART_FUNC">
<tt class="descname">FIELD_IN_PART_FUNC</tt><em class="property"> = 524288</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.FIELD_IN_PART_FUNC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.FIELD_IS_RENAMED">
<tt class="descname">FIELD_IS_RENAMED</tt><em class="property"> = 2097152</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.FIELD_IS_RENAMED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.GET_FIXED_FIELDS">
<tt class="descname">GET_FIXED_FIELDS</tt><em class="property"> = 262144</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.GET_FIXED_FIELDS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.GROUP">
<tt class="descname">GROUP</tt><em class="property"> = 16384</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.GROUP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.MULTIPLE_KEY">
<tt class="descname">MULTIPLE_KEY</tt><em class="property"> = 8</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.MULTIPLE_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.NOT_NULL">
<tt class="descname">NOT_NULL</tt><em class="property"> = 1</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.NOT_NULL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.NO_DEFAULT_VALUE">
<tt class="descname">NO_DEFAULT_VALUE</tt><em class="property"> = 4096</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.NO_DEFAULT_VALUE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.NUM">
<tt class="descname">NUM</tt><em class="property"> = 16384</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.NUM" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.ON_UPDATE_NOW">
<tt class="descname">ON_UPDATE_NOW</tt><em class="property"> = 8192</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.ON_UPDATE_NOW" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.PART_KEY">
<tt class="descname">PART_KEY</tt><em class="property"> = 32768</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.PART_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.PRI_KEY">
<tt class="descname">PRI_KEY</tt><em class="property"> = 2</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.PRI_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.SET">
<tt class="descname">SET</tt><em class="property"> = 2048</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.SET" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.TIMESTAMP">
<tt class="descname">TIMESTAMP</tt><em class="property"> = 1024</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.TIMESTAMP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.UNIQUE">
<tt class="descname">UNIQUE</tt><em class="property"> = 65536</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.UNIQUE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.UNIQUE_KEY">
<tt class="descname">UNIQUE_KEY</tt><em class="property"> = 4</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.UNIQUE_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.UNSIGNED">
<tt class="descname">UNSIGNED</tt><em class="property"> = 32</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.UNSIGNED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.ZEROFILL">
<tt class="descname">ZEROFILL</tt><em class="property"> = 64</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.ZEROFILL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldFlag.desc">
<tt class="descname">desc</tt><em class="property"> = {'GROUP': (16384, 'Intern: Group field'), 'FIELD_IN_PART_FUNC': (524288, 'Field part of partition func'), 'PRI_KEY': (2, 'Field is part of a primary key'), 'NO_DEFAULT_VALUE': (4096, &quot;Field doesn't have default value&quot;), 'PART_KEY': (32768, 'Intern; Part of some key'), 'NOT_NULL': (1, &quot;Field can't be NULL&quot;), 'MULTIPLE_KEY': (8, 'Field is part of a key'), 'SET': (2048, 'field is a set'), 'UNIQUE_KEY': (4, 'Field is part of a unique key'), 'AUTO_INCREMENT': (512, 'field is a autoincrement field'), 'UNSIGNED': (32, 'Field is unsigned'), 'GET_FIXED_FIELDS': (262144, 'Used to get fields in item tree'), 'NUM': (16384, 'Field is num (for clients)'), 'FIELD_IN_ADD_INDEX': (1048576, 'Intern: Field used in ADD INDEX'), 'ZEROFILL': (64, 'Field is zerofill'), 'ON_UPDATE_NOW': (8192, 'Field is set to NOW on UPDATE'), 'ENUM': (256, 'field is an enum'), 'BINCMP': (131072, 'Intern: Used by sql_yacc'), 'FIELD_IS_RENAMED': (2097152, 'Intern: Field is being renamed'), 'UNIQUE': (65536, 'Intern: Used by sql_yacc'), 'BINARY': (128, 'Field is binary  '), 'TIMESTAMP': (1024, 'Field is a timestamp'), 'BLOB': (16, 'Field is a blob')}</em><a class="headerlink" href="#mysql.connector.constants.FieldFlag.desc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.constants.FieldType">
<em class="property">class </em><tt class="descclassname">mysql.connector.constants.</tt><tt class="descname">FieldType</tt><a class="headerlink" href="#mysql.connector.constants.FieldType" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constants</span></tt></p>
<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.BIT">
<tt class="descname">BIT</tt><em class="property"> = 16</em><a class="headerlink" href="#mysql.connector.constants.FieldType.BIT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.BLOB">
<tt class="descname">BLOB</tt><em class="property"> = 252</em><a class="headerlink" href="#mysql.connector.constants.FieldType.BLOB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.DATE">
<tt class="descname">DATE</tt><em class="property"> = 10</em><a class="headerlink" href="#mysql.connector.constants.FieldType.DATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.DATETIME">
<tt class="descname">DATETIME</tt><em class="property"> = 12</em><a class="headerlink" href="#mysql.connector.constants.FieldType.DATETIME" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.DECIMAL">
<tt class="descname">DECIMAL</tt><em class="property"> = 0</em><a class="headerlink" href="#mysql.connector.constants.FieldType.DECIMAL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.DOUBLE">
<tt class="descname">DOUBLE</tt><em class="property"> = 5</em><a class="headerlink" href="#mysql.connector.constants.FieldType.DOUBLE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.ENUM">
<tt class="descname">ENUM</tt><em class="property"> = 247</em><a class="headerlink" href="#mysql.connector.constants.FieldType.ENUM" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.FLOAT">
<tt class="descname">FLOAT</tt><em class="property"> = 4</em><a class="headerlink" href="#mysql.connector.constants.FieldType.FLOAT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.GEOMETRY">
<tt class="descname">GEOMETRY</tt><em class="property"> = 255</em><a class="headerlink" href="#mysql.connector.constants.FieldType.GEOMETRY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.INT24">
<tt class="descname">INT24</tt><em class="property"> = 9</em><a class="headerlink" href="#mysql.connector.constants.FieldType.INT24" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.LONG">
<tt class="descname">LONG</tt><em class="property"> = 3</em><a class="headerlink" href="#mysql.connector.constants.FieldType.LONG" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.LONGLONG">
<tt class="descname">LONGLONG</tt><em class="property"> = 8</em><a class="headerlink" href="#mysql.connector.constants.FieldType.LONGLONG" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.LONG_BLOB">
<tt class="descname">LONG_BLOB</tt><em class="property"> = 251</em><a class="headerlink" href="#mysql.connector.constants.FieldType.LONG_BLOB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.MEDIUM_BLOB">
<tt class="descname">MEDIUM_BLOB</tt><em class="property"> = 250</em><a class="headerlink" href="#mysql.connector.constants.FieldType.MEDIUM_BLOB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.NEWDATE">
<tt class="descname">NEWDATE</tt><em class="property"> = 14</em><a class="headerlink" href="#mysql.connector.constants.FieldType.NEWDATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.NEWDECIMAL">
<tt class="descname">NEWDECIMAL</tt><em class="property"> = 246</em><a class="headerlink" href="#mysql.connector.constants.FieldType.NEWDECIMAL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.NULL">
<tt class="descname">NULL</tt><em class="property"> = 6</em><a class="headerlink" href="#mysql.connector.constants.FieldType.NULL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.SET">
<tt class="descname">SET</tt><em class="property"> = 248</em><a class="headerlink" href="#mysql.connector.constants.FieldType.SET" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.SHORT">
<tt class="descname">SHORT</tt><em class="property"> = 2</em><a class="headerlink" href="#mysql.connector.constants.FieldType.SHORT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.STRING">
<tt class="descname">STRING</tt><em class="property"> = 254</em><a class="headerlink" href="#mysql.connector.constants.FieldType.STRING" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.TIME">
<tt class="descname">TIME</tt><em class="property"> = 11</em><a class="headerlink" href="#mysql.connector.constants.FieldType.TIME" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.TIMESTAMP">
<tt class="descname">TIMESTAMP</tt><em class="property"> = 7</em><a class="headerlink" href="#mysql.connector.constants.FieldType.TIMESTAMP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.TINY">
<tt class="descname">TINY</tt><em class="property"> = 1</em><a class="headerlink" href="#mysql.connector.constants.FieldType.TINY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.TINY_BLOB">
<tt class="descname">TINY_BLOB</tt><em class="property"> = 249</em><a class="headerlink" href="#mysql.connector.constants.FieldType.TINY_BLOB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.VARCHAR">
<tt class="descname">VARCHAR</tt><em class="property"> = 15</em><a class="headerlink" href="#mysql.connector.constants.FieldType.VARCHAR" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.VAR_STRING">
<tt class="descname">VAR_STRING</tt><em class="property"> = 253</em><a class="headerlink" href="#mysql.connector.constants.FieldType.VAR_STRING" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.YEAR">
<tt class="descname">YEAR</tt><em class="property"> = 13</em><a class="headerlink" href="#mysql.connector.constants.FieldType.YEAR" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.desc">
<tt class="descname">desc</tt><em class="property"> = {'LONGLONG': (8, 'LONGLONG'), 'SHORT': (2, 'SHORT'), 'LONG': (3, 'LONG'), 'DATE': (10, 'DATE'), 'NEWDATE': (14, 'NEWDATE'), 'NULL': (6, 'NULL'), 'TIMESTAMP': (7, 'TIMESTAMP'), 'SET': (248, 'SET'), 'VARCHAR': (15, 'VARCHAR'), 'TINY': (1, 'TINY'), 'NEWDECIMAL': (246, 'NEWDECIMAL'), 'BIT': (16, 'BIT'), 'MEDIUM_BLOB': (250, 'MEDIUM_BLOB'), 'VAR_STRING': (253, 'VAR_STRING'), 'STRING': (254, 'STRING'), 'DECIMAL': (0, 'DECIMAL'), 'ENUM': (247, 'ENUM'), 'TINY_BLOB': (249, 'TINY_BLOB'), 'DATETIME': (12, 'DATETIME'), 'YEAR': (13, 'YEAR'), 'INT24': (9, 'INT24'), 'DOUBLE': (5, 'DOUBLE'), 'FLOAT': (4, 'FLOAT'), 'GEOMETRY': (255, 'GEOMETRY'), 'BLOB': (252, 'BLOB'), 'TIME': (11, 'TIME'), 'LONG_BLOB': (251, 'LONG_BLOB')}</em><a class="headerlink" href="#mysql.connector.constants.FieldType.desc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.constants.FieldType.get_binary_types">
<em class="property">classmethod </em><tt class="descname">get_binary_types</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.constants.FieldType.get_binary_types" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.constants.FieldType.get_number_types">
<em class="property">classmethod </em><tt class="descname">get_number_types</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.constants.FieldType.get_number_types" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.constants.FieldType.get_string_types">
<em class="property">classmethod </em><tt class="descname">get_string_types</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.constants.FieldType.get_string_types" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.constants.FieldType.get_timestamp_types">
<em class="property">classmethod </em><tt class="descname">get_timestamp_types</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.constants.FieldType.get_timestamp_types" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.FieldType.prefix">
<tt class="descname">prefix</tt><em class="property"> = 'FIELD_TYPE_'</em><a class="headerlink" href="#mysql.connector.constants.FieldType.prefix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.constants.RefreshOption">
<em class="property">class </em><tt class="descclassname">mysql.connector.constants.</tt><tt class="descname">RefreshOption</tt><a class="headerlink" href="#mysql.connector.constants.RefreshOption" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constants</span></tt></p>
<p>Options used when sending the COM_REFRESH server command.</p>
<dl class="attribute">
<dt id="mysql.connector.constants.RefreshOption.GRANT">
<tt class="descname">GRANT</tt><em class="property"> = 1</em><a class="headerlink" href="#mysql.connector.constants.RefreshOption.GRANT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.RefreshOption.HOST">
<tt class="descname">HOST</tt><em class="property"> = 8</em><a class="headerlink" href="#mysql.connector.constants.RefreshOption.HOST" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.RefreshOption.LOG">
<tt class="descname">LOG</tt><em class="property"> = 2</em><a class="headerlink" href="#mysql.connector.constants.RefreshOption.LOG" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.RefreshOption.SLAVE">
<tt class="descname">SLAVE</tt><em class="property"> = 64</em><a class="headerlink" href="#mysql.connector.constants.RefreshOption.SLAVE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.RefreshOption.STATUS">
<tt class="descname">STATUS</tt><em class="property"> = 16</em><a class="headerlink" href="#mysql.connector.constants.RefreshOption.STATUS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.RefreshOption.TABLES">
<tt class="descname">TABLES</tt><em class="property"> = 4</em><a class="headerlink" href="#mysql.connector.constants.RefreshOption.TABLES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.RefreshOption.THREADS">
<tt class="descname">THREADS</tt><em class="property"> = 32</em><a class="headerlink" href="#mysql.connector.constants.RefreshOption.THREADS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.RefreshOption.desc">
<tt class="descname">desc</tt><em class="property"> = {'STATUS': (16, 'Flush status variables'), 'TABLES': (4, 'close all tables'), 'SLAVE': (64, 'Reset master info and restart slave thread'), 'LOG': (2, 'Start on new log file'), 'GRANT': (1, 'Refresh grant tables'), 'THREADS': (32, 'Flush thread cache'), 'HOSTS': (8, 'Flush host cache')}</em><a class="headerlink" href="#mysql.connector.constants.RefreshOption.desc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.constants.ServerCmd">
<em class="property">class </em><tt class="descclassname">mysql.connector.constants.</tt><tt class="descname">ServerCmd</tt><a class="headerlink" href="#mysql.connector.constants.ServerCmd" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constants</span></tt></p>
<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.BINLOG_DUMP">
<tt class="descname">BINLOG_DUMP</tt><em class="property"> = 18</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.BINLOG_DUMP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.CHANGE_USER">
<tt class="descname">CHANGE_USER</tt><em class="property"> = 17</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.CHANGE_USER" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.CONNECT">
<tt class="descname">CONNECT</tt><em class="property"> = 11</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.CONNECT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.CONNECT_OUT">
<tt class="descname">CONNECT_OUT</tt><em class="property"> = 20</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.CONNECT_OUT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.CREATE_DB">
<tt class="descname">CREATE_DB</tt><em class="property"> = 5</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.CREATE_DB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.DAEMON">
<tt class="descname">DAEMON</tt><em class="property"> = 29</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.DAEMON" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.DEBUG">
<tt class="descname">DEBUG</tt><em class="property"> = 13</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.DEBUG" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.DELAYED_INSERT">
<tt class="descname">DELAYED_INSERT</tt><em class="property"> = 16</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.DELAYED_INSERT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.DROP_DB">
<tt class="descname">DROP_DB</tt><em class="property"> = 6</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.DROP_DB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.FIELD_LIST">
<tt class="descname">FIELD_LIST</tt><em class="property"> = 4</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.FIELD_LIST" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.INIT_DB">
<tt class="descname">INIT_DB</tt><em class="property"> = 2</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.INIT_DB" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.PING">
<tt class="descname">PING</tt><em class="property"> = 14</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.PING" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.PROCESS_INFO">
<tt class="descname">PROCESS_INFO</tt><em class="property"> = 10</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.PROCESS_INFO" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.PROCESS_KILL">
<tt class="descname">PROCESS_KILL</tt><em class="property"> = 12</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.PROCESS_KILL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.QUERY">
<tt class="descname">QUERY</tt><em class="property"> = 3</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.QUERY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.QUIT">
<tt class="descname">QUIT</tt><em class="property"> = 1</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.QUIT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.REFRESH">
<tt class="descname">REFRESH</tt><em class="property"> = 7</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.REFRESH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.REGISTER_SLAVE">
<tt class="descname">REGISTER_SLAVE</tt><em class="property"> = 21</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.REGISTER_SLAVE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.SET_OPTION">
<tt class="descname">SET_OPTION</tt><em class="property"> = 27</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.SET_OPTION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.SHUTDOWN">
<tt class="descname">SHUTDOWN</tt><em class="property"> = 8</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.SHUTDOWN" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.SLEEP">
<tt class="descname">SLEEP</tt><em class="property"> = 0</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.SLEEP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.STATISTICS">
<tt class="descname">STATISTICS</tt><em class="property"> = 9</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.STATISTICS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.STMT_CLOSE">
<tt class="descname">STMT_CLOSE</tt><em class="property"> = 25</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.STMT_CLOSE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.STMT_EXECUTE">
<tt class="descname">STMT_EXECUTE</tt><em class="property"> = 23</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.STMT_EXECUTE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.STMT_FETCH">
<tt class="descname">STMT_FETCH</tt><em class="property"> = 28</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.STMT_FETCH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.STMT_PREPARE">
<tt class="descname">STMT_PREPARE</tt><em class="property"> = 22</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.STMT_PREPARE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.STMT_RESET">
<tt class="descname">STMT_RESET</tt><em class="property"> = 26</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.STMT_RESET" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.STMT_SEND_LONG_DATA">
<tt class="descname">STMT_SEND_LONG_DATA</tt><em class="property"> = 24</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.STMT_SEND_LONG_DATA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.TABLE_DUMP">
<tt class="descname">TABLE_DUMP</tt><em class="property"> = 19</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.TABLE_DUMP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerCmd.TIME">
<tt class="descname">TIME</tt><em class="property"> = 15</em><a class="headerlink" href="#mysql.connector.constants.ServerCmd.TIME" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.constants.ServerFlag">
<em class="property">class </em><tt class="descclassname">mysql.connector.constants.</tt><tt class="descname">ServerFlag</tt><a class="headerlink" href="#mysql.connector.constants.ServerFlag" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.constants._constantflags</span></tt></p>
<p>Server flags as found in the MySQL sources mysql-src/include/mysql_com.h</p>
<dl class="attribute">
<dt id="mysql.connector.constants.ServerFlag.MORE_RESULTS_EXISTS">
<tt class="descname">MORE_RESULTS_EXISTS</tt><em class="property"> = 8</em><a class="headerlink" href="#mysql.connector.constants.ServerFlag.MORE_RESULTS_EXISTS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerFlag.QUERY_NO_GOOD_INDEX_USED">
<tt class="descname">QUERY_NO_GOOD_INDEX_USED</tt><em class="property"> = 16</em><a class="headerlink" href="#mysql.connector.constants.ServerFlag.QUERY_NO_GOOD_INDEX_USED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerFlag.QUERY_NO_INDEX_USED">
<tt class="descname">QUERY_NO_INDEX_USED</tt><em class="property"> = 32</em><a class="headerlink" href="#mysql.connector.constants.ServerFlag.QUERY_NO_INDEX_USED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerFlag.STATUS_AUTOCOMMIT">
<tt class="descname">STATUS_AUTOCOMMIT</tt><em class="property"> = 2</em><a class="headerlink" href="#mysql.connector.constants.ServerFlag.STATUS_AUTOCOMMIT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerFlag.STATUS_CURSOR_EXISTS">
<tt class="descname">STATUS_CURSOR_EXISTS</tt><em class="property"> = 64</em><a class="headerlink" href="#mysql.connector.constants.ServerFlag.STATUS_CURSOR_EXISTS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerFlag.STATUS_DB_DROPPED">
<tt class="descname">STATUS_DB_DROPPED</tt><em class="property"> = 256</em><a class="headerlink" href="#mysql.connector.constants.ServerFlag.STATUS_DB_DROPPED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerFlag.STATUS_IN_TRANS">
<tt class="descname">STATUS_IN_TRANS</tt><em class="property"> = 1</em><a class="headerlink" href="#mysql.connector.constants.ServerFlag.STATUS_IN_TRANS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerFlag.STATUS_LAST_ROW_SENT">
<tt class="descname">STATUS_LAST_ROW_SENT</tt><em class="property"> = 128</em><a class="headerlink" href="#mysql.connector.constants.ServerFlag.STATUS_LAST_ROW_SENT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerFlag.STATUS_NO_BACKSLASH_ESCAPES">
<tt class="descname">STATUS_NO_BACKSLASH_ESCAPES</tt><em class="property"> = 512</em><a class="headerlink" href="#mysql.connector.constants.ServerFlag.STATUS_NO_BACKSLASH_ESCAPES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mysql.connector.constants.ServerFlag.desc">
<tt class="descname">desc</tt><em class="property"> = {'SERVER_STATUS_DB_DROPPED': (256, 'A database was dropped'), 'SERVER_MORE_RESULTS_EXISTS': (8, 'Multi query - next query exists'), 'SERVER_STATUS_NO_BACKSLASH_ESCAPES': (512, ''), 'SERVER_STATUS_CURSOR_EXISTS': (64, ''), 'SERVER_STATUS_AUTOCOMMIT': (2, 'Server in auto_commit mode'), 'SERVER_STATUS_LAST_ROW_SENT': (128, ''), 'SERVER_QUERY_NO_INDEX_USED': (32, ''), 'SERVER_STATUS_IN_TRANS': (1, 'Transaction has started'), 'SERVER_QUERY_NO_GOOD_INDEX_USED': (16, '')}</em><a class="headerlink" href="#mysql.connector.constants.ServerFlag.desc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-mysql.connector.conversion">
<span id="conversion-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">conversion</span></tt> Module<a class="headerlink" href="#module-mysql.connector.conversion" title="Permalink to this headline">¶</a></h2>
<p>Converting MySQL and Python types</p>
<dl class="class">
<dt id="mysql.connector.conversion.ConverterBase">
<em class="property">class </em><tt class="descclassname">mysql.connector.conversion.</tt><tt class="descname">ConverterBase</tt><big>(</big><em>charset='utf8'</em>, <em>use_unicode=True</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.ConverterBase" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<dl class="method">
<dt id="mysql.connector.conversion.ConverterBase.escape">
<tt class="descname">escape</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.ConverterBase.escape" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.conversion.ConverterBase.quote">
<tt class="descname">quote</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.ConverterBase.quote" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.conversion.ConverterBase.set_charset">
<tt class="descname">set_charset</tt><big>(</big><em>charset</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.ConverterBase.set_charset" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.conversion.ConverterBase.set_unicode">
<tt class="descname">set_unicode</tt><big>(</big><em>value=True</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.ConverterBase.set_unicode" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.conversion.ConverterBase.to_mysql">
<tt class="descname">to_mysql</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.ConverterBase.to_mysql" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.conversion.ConverterBase.to_python">
<tt class="descname">to_python</tt><big>(</big><em>vtype</em>, <em>value</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.ConverterBase.to_python" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.conversion.MySQLConverter">
<em class="property">class </em><tt class="descclassname">mysql.connector.conversion.</tt><tt class="descname">MySQLConverter</tt><big>(</big><em>charset=None</em>, <em>use_unicode=True</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.MySQLConverter" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.conversion.ConverterBase" title="mysql.connector.conversion.ConverterBase"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.conversion.ConverterBase</span></tt></a></p>
<dl class="docutils">
<dt>A converted class grouping:</dt>
<dd><p class="first">o escape method: for escpaing values send to MySQL
o quoting method: for quoting values send to MySQL in statements
o conversion mapping: maps Python and MySQL data types to</p>
<blockquote class="last">
<div>function for converting them.</div></blockquote>
</dd>
</dl>
<p>This class should be overloaded whenever one needs differences
in how values are to be converted. Each MySQLConnection object
has a default_converter property, which can be set like</p>
<blockquote>
<div>MySQL.converter(CustomMySQLConverter)</div></blockquote>
<dl class="method">
<dt id="mysql.connector.conversion.MySQLConverter.escape">
<tt class="descname">escape</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.MySQLConverter.escape" title="Permalink to this definition">¶</a></dt>
<dd><p>Escapes special characters as they are expected to by when MySQL
receives them.
As found in MySQL source mysys/charset.c</p>
<p>Returns the value if not a string, or the escaped string.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.conversion.MySQLConverter.quote">
<tt class="descname">quote</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.MySQLConverter.quote" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Quote the parameters for commands. General rules:</dt>
<dd>o numbers are returns as str type (because operation expect it)
o None is returned as str(&#8216;NULL&#8217;)
o String are quoted with single quotes &#8216;&lt;string&gt;&#8217;</dd>
</dl>
<p>Returns a string.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.conversion.MySQLConverter.to_mysql">
<tt class="descname">to_mysql</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.MySQLConverter.to_mysql" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.conversion.MySQLConverter.to_python">
<tt class="descname">to_python</tt><big>(</big><em>flddsc</em>, <em>value</em><big>)</big><a class="headerlink" href="#mysql.connector.conversion.MySQLConverter.to_python" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a given value coming from MySQL to a certain type in Python.
The flddsc contains additional information for the field in the
table. It&#8217;s an element from MySQLCursor.description.</p>
<p>Returns a mixed value.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-mysql.connector.cursor">
<span id="cursor-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">cursor</span></tt> Module<a class="headerlink" href="#module-mysql.connector.cursor" title="Permalink to this headline">¶</a></h2>
<p>Cursor classes</p>
<dl class="class">
<dt id="mysql.connector.cursor.CursorBase">
<em class="property">class </em><tt class="descclassname">mysql.connector.cursor.</tt><tt class="descname">CursorBase</tt><a class="headerlink" href="#mysql.connector.cursor.CursorBase" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>Base for defining MySQLCursor. This class is a skeleton and defines
methods and members as required for the Python Database API
Specification v2.0.</p>
<p>It&#8217;s better to inherite from MySQLCursor.</p>
<dl class="method">
<dt id="mysql.connector.cursor.CursorBase.callproc">
<tt class="descname">callproc</tt><big>(</big><em>procname</em>, <em>args=()</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.CursorBase.callproc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.CursorBase.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.CursorBase.close" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.CursorBase.execute">
<tt class="descname">execute</tt><big>(</big><em>operation</em>, <em>params=()</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.CursorBase.execute" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.CursorBase.executemany">
<tt class="descname">executemany</tt><big>(</big><em>operation</em>, <em>seqparams</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.CursorBase.executemany" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.CursorBase.fetchall">
<tt class="descname">fetchall</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.CursorBase.fetchall" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.CursorBase.fetchmany">
<tt class="descname">fetchmany</tt><big>(</big><em>size=1</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.CursorBase.fetchmany" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.CursorBase.fetchone">
<tt class="descname">fetchone</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.CursorBase.fetchone" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.CursorBase.nextset">
<tt class="descname">nextset</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.CursorBase.nextset" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.CursorBase.reset">
<tt class="descname">reset</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.CursorBase.reset" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.CursorBase.setinputsizes">
<tt class="descname">setinputsizes</tt><big>(</big><em>sizes</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.CursorBase.setinputsizes" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.CursorBase.setoutputsize">
<tt class="descname">setoutputsize</tt><big>(</big><em>size</em>, <em>column=None</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.CursorBase.setoutputsize" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.cursor.MySQLCursor">
<em class="property">class </em><tt class="descclassname">mysql.connector.cursor.</tt><tt class="descname">MySQLCursor</tt><big>(</big><em>db=None</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.cursor.CursorBase" title="mysql.connector.cursor.CursorBase"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.cursor.CursorBase</span></tt></a></p>
<p>Default cursor which fetches all rows and stores it for later
usage. It uses the converter set for the MySQLConnection to map
MySQL types to Python types automatically.</p>
<p>This class should be inherited whenever other functionallity is
required. An example would to change the fetch* member functions
to return dictionaries instead of lists of values.</p>
<p>Implements the Python Database API Specification v2.0.</p>
<p>Possible parameters are:</p>
<dl class="docutils">
<dt>db</dt>
<dd>A MySQLConnection instance.</dd>
</dl>
<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursor.callproc">
<tt class="descname">callproc</tt><big>(</big><em>procname</em>, <em>args=()</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor.callproc" title="Permalink to this definition">¶</a></dt>
<dd><p>Calls a stored procedue with the given arguments</p>
<p>The arguments will be set during this session, meaning
they will be called like  _&lt;procname&gt;__arg&lt;nr&gt; where
&lt;nr&gt; is an enumeration (+1) of the arguments.</p>
<dl class="docutils">
<dt>Coding Example:</dt>
<dd><p class="first">1) Definining the Stored Routine in MySQL:
CREATE PROCEDURE multiply(IN pFac1 INT, IN pFac2 INT, OUT pProd INT)
BEGIN</p>
<blockquote>
<div>SET pProd := pFac1 * pFac2;</div></blockquote>
<p>END</p>
<p>2) Executing in Python:
args = (5,5,0) # 0 is to hold pprod
cursor.callproc(multiply, args)
print cursor.fetchone()</p>
<p class="last">The last print should output (&#8216;5&#8217;, &#8216;5&#8217;, 25L)</p>
</dd>
</dl>
<p>Does not return a value, but a result set will be
available when the CALL-statement execute succesfully.
Raises exceptions when something is wrong.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursor.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Close the cursor, disconnecting it from the MySQL object.</p>
<p>Returns True when succesful, otherwise False.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursor.execute">
<tt class="descname">execute</tt><big>(</big><em>operation</em>, <em>params=None</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor.execute" title="Permalink to this definition">¶</a></dt>
<dd><p>Executes the given operation. The parameters given through params
are used to substitute %%s in the operation string.
For example, getting all rows where id is 5:</p>
<blockquote>
<div>cursor.execute(&#8220;SELECT * FROM t1 WHERE id = %s&#8221;, (5,))</div></blockquote>
<p>If warnings where generated, and db.get_warnings is True, then
self._warnings will be a list containing these warnings.</p>
<p>Raises exceptions when any error happens.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursor.executemany">
<tt class="descname">executemany</tt><big>(</big><em>operation</em>, <em>seq_params</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor.executemany" title="Permalink to this definition">¶</a></dt>
<dd><p>Loops over seq_params and calls excute()</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursor.fetchall">
<tt class="descname">fetchall</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor.fetchall" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursor.fetchmany">
<tt class="descname">fetchmany</tt><big>(</big><em>size=None</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor.fetchmany" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursor.fetchone">
<tt class="descname">fetchone</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor.fetchone" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursor.fetchwarnings">
<tt class="descname">fetchwarnings</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor.fetchwarnings" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursor.getlastrowid">
<tt class="descname">getlastrowid</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor.getlastrowid" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursor.next">
<tt class="descname">next</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor.next" title="Permalink to this definition">¶</a></dt>
<dd><p>Used for iterating over the result set. Calles self.fetchone()
to get the next row.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursor.set_connection">
<tt class="descname">set_connection</tt><big>(</big><em>db</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursor.set_connection" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.cursor.MySQLCursorBuffered">
<em class="property">class </em><tt class="descclassname">mysql.connector.cursor.</tt><tt class="descname">MySQLCursorBuffered</tt><big>(</big><em>db=None</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursorBuffered" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.cursor.MySQLCursor" title="mysql.connector.cursor.MySQLCursor"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.cursor.MySQLCursor</span></tt></a></p>
<p>Cursor which fetches rows within execute()</p>
<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursorBuffered.fetchall">
<tt class="descname">fetchall</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursorBuffered.fetchall" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursorBuffered.fetchmany">
<tt class="descname">fetchmany</tt><big>(</big><em>size=None</em><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursorBuffered.fetchmany" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.cursor.MySQLCursorBuffered.reset">
<tt class="descname">reset</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.cursor.MySQLCursorBuffered.reset" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-mysql.connector.dbapi">
<span id="dbapi-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">dbapi</span></tt> Module<a class="headerlink" href="#module-mysql.connector.dbapi" title="Permalink to this headline">¶</a></h2>
<p>DB API v2.0 required</p>
<dl class="function">
<dt id="mysql.connector.dbapi.DateFromTicks">
<tt class="descclassname">mysql.connector.dbapi.</tt><tt class="descname">DateFromTicks</tt><big>(</big><em>ticks</em><big>)</big><a class="headerlink" href="#mysql.connector.dbapi.DateFromTicks" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="mysql.connector.dbapi.TimeFromTicks">
<tt class="descclassname">mysql.connector.dbapi.</tt><tt class="descname">TimeFromTicks</tt><big>(</big><em>ticks</em><big>)</big><a class="headerlink" href="#mysql.connector.dbapi.TimeFromTicks" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="mysql.connector.dbapi.TimestampFromTicks">
<tt class="descclassname">mysql.connector.dbapi.</tt><tt class="descname">TimestampFromTicks</tt><big>(</big><em>ticks</em><big>)</big><a class="headerlink" href="#mysql.connector.dbapi.TimestampFromTicks" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-mysql.connector.errors">
<span id="errors-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">errors</span></tt> Module<a class="headerlink" href="#module-mysql.connector.errors" title="Permalink to this headline">¶</a></h2>
<p>Python exceptions</p>
<dl class="class">
<dt id="mysql.connector.errors.ClientError">
<em class="property">class </em><tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">ClientError</tt><a class="headerlink" href="#mysql.connector.errors.ClientError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<dl class="attribute">
<dt id="mysql.connector.errors.ClientError.client_errors">
<tt class="descname">client_errors</tt><em class="property"> = {2048: 'Invalid connection handle', 2049: &quot;Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)&quot;, 2050: 'Row retrieval was canceled by mysql_stmt_close() call', 2051: 'Attempt to read column without prior row fetch', 2052: 'Prepared statement contains no metadata', 2053: 'Attempt to read a row while there is no result set associated with the statement', 2054: 'This feature is not implemented yet', 2055: &quot;Lost connection to MySQL server at '%s', system error: %d&quot;, 2056: 'Statement closed indirectly because of a preceeding %s() call', 2057: 'The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again', 2000: 'Unknown MySQL error', 2001: &quot;Can't create UNIX socket (%d)&quot;, 2002: &quot;Can't connect to local MySQL server through socket '%s' (%s)&quot;, 2003: &quot;Can't connect to MySQL server on '%s' (%s)&quot;, 2004: &quot;Can't create TCP/IP socket (%s)&quot;, 2005: &quot;Unknown MySQL server host '%s' (%s)&quot;, 2006: 'MySQL server has gone away', 2007: 'Protocol mismatch; server version = %d, client version = %d', 2008: 'MySQL client ran out of memory', 2009: 'Wrong host info', 2010: 'Localhost via UNIX socket', 2011: '%s via TCP/IP', 2012: 'Error in server handshake', 2013: 'Lost connection to MySQL server during query', 2014: &quot;Commands out of sync; you can't run this command now&quot;, 2015: 'Named pipe: %s', 2016: &quot;Can't wait for named pipe to host: %s  pipe: %s (%d)&quot;, 2017: &quot;Can't open named pipe to host: %s  pipe: %s (%d)&quot;, 2018: &quot;Can't set state of named pipe to host: %s  pipe: %s (%d)&quot;, 2019: &quot;Can't initialize character set %s (path: %s)&quot;, 2020: &quot;Got packet bigger than 'max_allowed_packet' bytes&quot;, 2021: 'Embedded server', 2022: 'Error on SHOW SLAVE STATUS:', 2023: 'Error on SHOW SLAVE HOSTS:', 2024: 'Error connecting to slave:', 2025: 'Error connecting to master:', 2026: 'SSL connection error', 2027: 'Malformed packet', 2028: &quot;This client library is licensed only for use with MySQL servers having '%s' license&quot;, 2029: 'Invalid use of null pointer', 2030: 'Statement not prepared', 2031: 'No data supplied for parameters in prepared statement', 2032: 'Data truncated', 2033: 'No parameters exist in the statement', 2034: 'Invalid parameter number', 2035: &quot;Can't send long data for non-string/non-binary data types (parameter: %d)&quot;, 2036: 'Using unsupported buffer type: %d  (parameter: %d)', 2037: 'Shared memory: %s', 2038: &quot;Can't open shared memory; client could not create request event (%d)&quot;, 2039: &quot;Can't open shared memory; no answer event received from server (%d)&quot;, 2040: &quot;Can't open shared memory; server could not allocate file mapping (%d)&quot;, 2041: &quot;Can't open shared memory; server could not get pointer to file mapping (%d)&quot;, 2042: &quot;Can't open shared memory; client could not allocate file mapping (%d)&quot;, 2043: &quot;Can't open shared memory; client could not get pointer to file mapping (%d)&quot;, 2044: &quot;Can't open shared memory; client could not create %s event (%d)&quot;, 2045: &quot;Can't open shared memory; no answer from server (%d)&quot;, 2046: &quot;Can't open shared memory; cannot send request event to server (%d)&quot;, 2047: 'Wrong or unknown protocol'}</em><a class="headerlink" href="#mysql.connector.errors.ClientError.client_errors" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="classmethod">
<dt id="mysql.connector.errors.ClientError.get_error_msg">
<em class="property">classmethod </em><tt class="descname">get_error_msg</tt><big>(</big><em>errno</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.errors.ClientError.get_error_msg" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="exception">
<dt id="mysql.connector.errors.DataError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">DataError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.errors.DataError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.errors.DatabaseError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">DatabaseError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.errors.DatabaseError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.Error" title="mysql.connector.errors.Error"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.Error</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.errors.Error">
<em class="property">exception </em><tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">Error</tt><big>(</big><em>m</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.errors.Error" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.StandardError</span></tt></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.errors.IntegrityError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">IntegrityError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.errors.IntegrityError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.errors.InterfaceError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">InterfaceError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.errors.InterfaceError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.Error" title="mysql.connector.errors.Error"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.Error</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.errors.InternalError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">InternalError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.errors.InternalError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.errors.NotSupportedError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">NotSupportedError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.errors.NotSupportedError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.errors.OperationalError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">OperationalError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.errors.OperationalError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.errors.ProgrammingError">
<em class="property">exception </em><tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">ProgrammingError</tt><big>(</big><em>m=None</em>, <em>errno=None</em>, <em>values=None</em><big>)</big><a class="headerlink" href="#mysql.connector.errors.ProgrammingError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.errors.DatabaseError" title="mysql.connector.errors.DatabaseError"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.errors.DatabaseError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="mysql.connector.errors.Warning">
<em class="property">exception </em><tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">Warning</tt><a class="headerlink" href="#mysql.connector.errors.Warning" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.StandardError</span></tt></p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.errors.get_mysql_exception">
<tt class="descclassname">mysql.connector.errors.</tt><tt class="descname">get_mysql_exception</tt><big>(</big><em>errno</em>, <em>msg</em><big>)</big><a class="headerlink" href="#mysql.connector.errors.get_mysql_exception" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-mysql.connector.mysql">
<span id="mysql-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">mysql</span></tt> Module<a class="headerlink" href="#module-mysql.connector.mysql" title="Permalink to this headline">¶</a></h2>
<p>Main classes for interacting with MySQL</p>
<dl class="class">
<dt id="mysql.connector.mysql.MySQL">
<em class="property">class </em><tt class="descclassname">mysql.connector.mysql.</tt><tt class="descname">MySQL</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQL" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.mysql.MySQLBase" title="mysql.connector.mysql.MySQLBase"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.mysql.MySQLBase</span></tt></a></p>
<p>Class implementing Python DB API v2.0.</p>
<dl class="method">
<dt id="mysql.connector.mysql.MySQL.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQL.close" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQL.commit">
<tt class="descname">commit</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQL.commit" title="Permalink to this definition">¶</a></dt>
<dd><p>Shortcut for executing COMMIT.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQL.connect">
<tt class="descname">connect</tt><big>(</big><em>dsn=''</em>, <em>user=''</em>, <em>password=''</em>, <em>host='127.0.0.1'</em>, <em>port=3306</em>, <em>db=None</em>, <em>database=None</em>, <em>use_unicode=True</em>, <em>charset='utf8'</em>, <em>get_warnings=False</em>, <em>raise_on_warnings=False</em>, <em>autocommit=False</em>, <em>unix_socket=None</em>, <em>connection_timeout=None</em>, <em>client_flags=0</em>, <em>buffered=False</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQL.connect" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Establishes a connection to the MySQL Server. Called also when instansiating</dt>
<dd><p class="first">a new MySQLConnection object through the __init__ method.</p>
<p>Possible parameters are:</p>
<dl class="docutils">
<dt>dsn</dt>
<dd>(not used)</dd>
<dt>user</dt>
<dd>The username used to authenticate with the MySQL Server.</dd>
<dt>password</dt>
<dd>The password to authenticate the user with the MySQL Server.</dd>
<dt>host</dt>
<dd>The hostname or the IP address of the MySQL Server we are connecting with.
(default 127.0.0.1)</dd>
<dt>port</dt>
<dd>TCP port to use for connecting to the MySQL Server.
(default 3306)</dd>
</dl>
<p>database
db</p>
<blockquote>
<div>Initial database to use once we are connected with the MySQL Server.
The db argument is synonym, but database takes precedence.</div></blockquote>
<dl class="last docutils">
<dt>use_unicode</dt>
<dd>If set to true, string values received from MySQL will be returned
as Unicode strings.
Default: True</dd>
<dt>charset</dt>
<dd>Which character shall we use for sending data to MySQL. One can still
override this by using the SET NAMES command directly, but this is
discouraged. Instead, use the set_charset() method if you
want to change it.
Default: Whatever the MySQL server has default.</dd>
<dt>get_warnings</dt>
<dd>If set to true, whenever a query gives a warning, a SHOW WARNINGS will
be done to fetch them. They will be available as MySQLCursor.warnings.
The default is to ignore these warnings, for debugging it&#8217;s good to
enable it though, or use strict mode in MySQL to make most of these
warnings errors.
Default: False</dd>
<dt>raise_on_warnings</dt>
<dd>If set to True, warnings will be raised as exceptions. raise_on_warings
overrides get_warnings.
Default: False</dd>
<dt>autocommit</dt>
<dd>Auto commit is OFF by default, which is required by the Python Db API
2.0 specification.
Default: False</dd>
<dt>unix_socket</dt>
<dd>Full path to the MySQL Server UNIX socket. By default TCP connection will
be used using the address specified by the host argument.</dd>
<dt>connection_timeout</dt>
<dd>Timeout for the TCP and UNIX socket connection.</dd>
<dt>client_flags</dt>
<dd><dl class="first last docutils">
<dt>Allows to set flags for the connection. Check following for possible flags:</dt>
<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">mysql.connector.constants</span> <span class="kn">import</span> <span class="n">ClientFlag</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="s">&#39;</span>
</pre></div>
</div>
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
<p>&#8216;.join(ClientFlag.get_full_info())</p>
<blockquote>
<div><dl class="docutils">
<dt>buffered</dt>
<dd>When set to True .execute() will fetch the rows immediatly.</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQL.cursor">
<tt class="descname">cursor</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQL.cursor" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQL.remove_cursor">
<tt class="descname">remove_cursor</tt><big>(</big><em>c</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQL.remove_cursor" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQL.rollback">
<tt class="descname">rollback</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQL.rollback" title="Permalink to this definition">¶</a></dt>
<dd><p>Shortcut for executing ROLLBACK</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.mysql.MySQLBase">
<em class="property">class </em><tt class="descclassname">mysql.connector.mysql.</tt><tt class="descname">MySQLBase</tt><a class="headerlink" href="#mysql.connector.mysql.MySQLBase" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>MySQLBase</p>
<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.connect">
<tt class="descname">connect</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.connect" title="Permalink to this definition">¶</a></dt>
<dd><p>To be implemented while subclassing MySQLBase.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.disconnect">
<tt class="descname">disconnect</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.disconnect" title="Permalink to this definition">¶</a></dt>
<dd><p>Disconnect from the MySQL server.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.get_characterset_info">
<tt class="descname">get_characterset_info</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.get_characterset_info" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.get_server_info">
<tt class="descname">get_server_info</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.get_server_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the server version as a string</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.get_server_threadid">
<tt class="descname">get_server_threadid</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.get_server_threadid" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the MySQL threadid of the connection.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.get_server_version">
<tt class="descname">get_server_version</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.get_server_version" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the server version as a tuple</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.is_connected">
<tt class="descname">is_connected</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.is_connected" title="Permalink to this definition">¶</a></dt>
<dd><p>Check whether we are connected to the MySQL server.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.isset_client_flag">
<tt class="descname">isset_client_flag</tt><big>(</big><em>flag</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.isset_client_flag" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.ping">
<tt class="descname">ping</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.ping" title="Permalink to this definition">¶</a></dt>
<dd><p>Check whether we are connected to the MySQL server.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_autocommit">
<tt class="descname">set_autocommit</tt><big>(</big><em>switch</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_autocommit" title="Permalink to this definition">¶</a></dt>
<dd><p>Set auto commit on or off. The argument &#8216;switch&#8217; must be a boolean type.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_buffered">
<tt class="descname">set_buffered</tt><big>(</big><em>val=False</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_buffered" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets whether cursor .execute() fetches rows</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_charset">
<tt class="descname">set_charset</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_charset" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the character set used for the connection. This is the recommended
way of change it per connection basis. It does execute SET NAMES
internally, but it&#8217;s good not to use this command directly, since we
are setting some other members accordingly.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_charset_info">
<tt class="descname">set_charset_info</tt><big>(</big><em>info=None</em>, <em>charset=None</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_charset_info" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_client_flag">
<tt class="descname">set_client_flag</tt><big>(</big><em>flag</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_client_flag" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_client_flags">
<tt class="descname">set_client_flags</tt><big>(</big><em>flags</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_client_flags" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_connection_timeout">
<tt class="descname">set_connection_timeout</tt><big>(</big><em>timeout</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_connection_timeout" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_converter_class">
<tt class="descname">set_converter_class</tt><big>(</big><em>convclass</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_converter_class" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the converter class to be used. This should be a class overloading
methods and members of conversion.MySQLConverter.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_database">
<tt class="descname">set_database</tt><big>(</big><em>database</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_database" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the database to be used after connection succeeded.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_host">
<tt class="descname">set_host</tt><big>(</big><em>host</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_host" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the host for connection to the MySQL server.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_login">
<tt class="descname">set_login</tt><big>(</big><em>username=None</em>, <em>password=None</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_login" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the username and/or password for the user connecting to the MySQL Server.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_port">
<tt class="descname">set_port</tt><big>(</big><em>port</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_port" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the TCP port to be used when connecting to the server, usually 3306.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_unicode">
<tt class="descname">set_unicode</tt><big>(</big><em>value=True</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_unicode" title="Permalink to this definition">¶</a></dt>
<dd><p>Set whether we return string fields as unicode or not.
Default is True.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_unixsocket">
<tt class="descname">set_unixsocket</tt><big>(</big><em>loc</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_unixsocket" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the UNIX Socket location. Does not check if it exists.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.set_warnings">
<tt class="descname">set_warnings</tt><big>(</big><em>fetch=False</em>, <em>raise_on_warnings=False</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.set_warnings" title="Permalink to this definition">¶</a></dt>
<dd><p>Set how to handle warnings coming from MySQL</p>
<p>Set wheter we should get warnings whenever an operation produced some.
If you set raise_on_warnings to True, any warning will be raised
as a DataError exception.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.mysql.MySQLBase.unset_client_flag">
<tt class="descname">unset_client_flag</tt><big>(</big><em>flag</em><big>)</big><a class="headerlink" href="#mysql.connector.mysql.MySQLBase.unset_client_flag" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-mysql.connector.protocol">
<span id="protocol-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">protocol</span></tt> Module<a class="headerlink" href="#module-mysql.connector.protocol" title="Permalink to this headline">¶</a></h2>
<p>Implementing the MySQL Client/Server protocol</p>
<dl class="class">
<dt id="mysql.connector.protocol.Auth">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">Auth</tt><big>(</big><em>packet=None</em>, <em>client_flags=0</em>, <em>pktnr=0</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.Auth" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.protocol.PacketOut" title="mysql.connector.protocol.PacketOut"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.protocol.PacketOut</span></tt></a></p>
<dl class="method">
<dt id="mysql.connector.protocol.Auth.create">
<tt class="descname">create</tt><big>(</big><em>username=None</em>, <em>password=None</em>, <em>database=None</em>, <em>seed=None</em>, <em>charset=33</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.Auth.create" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.Auth.scramble">
<tt class="descname">scramble</tt><big>(</big><em>passwd</em>, <em>seed</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.Auth.scramble" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.Auth.set_client_flags">
<tt class="descname">set_client_flags</tt><big>(</big><em>flags</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.Auth.set_client_flags" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.Auth.set_login">
<tt class="descname">set_login</tt><big>(</big><em>username</em>, <em>password</em>, <em>database=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.Auth.set_login" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.BasePacket">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">BasePacket</tt><a class="headerlink" href="#mysql.connector.protocol.BasePacket" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<dl class="method">
<dt id="mysql.connector.protocol.BasePacket.is_valid">
<tt class="descname">is_valid</tt><big>(</big><em>buf=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.BasePacket.is_valid" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.ChangeUserPacket">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">ChangeUserPacket</tt><a class="headerlink" href="#mysql.connector.protocol.ChangeUserPacket" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.protocol.Auth" title="mysql.connector.protocol.Auth"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.protocol.Auth</span></tt></a></p>
<dl class="method">
<dt id="mysql.connector.protocol.ChangeUserPacket.create">
<tt class="descname">create</tt><big>(</big><em>username=None</em>, <em>password=None</em>, <em>database=None</em>, <em>charset=8</em>, <em>seed=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.ChangeUserPacket.create" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.CommandPacket">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">CommandPacket</tt><big>(</big><em>cmd=None</em>, <em>arg=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.CommandPacket" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.protocol.PacketOut" title="mysql.connector.protocol.PacketOut"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.protocol.PacketOut</span></tt></a></p>
<dl class="method">
<dt id="mysql.connector.protocol.CommandPacket.create">
<tt class="descname">create</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.CommandPacket.create" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.CommandPacket.set_argument">
<tt class="descname">set_argument</tt><big>(</big><em>arg</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.CommandPacket.set_argument" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.CommandPacket.set_command">
<tt class="descname">set_command</tt><big>(</big><em>cmd</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.CommandPacket.set_command" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.EOFPacket">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">EOFPacket</tt><big>(</big><em>buf=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.EOFPacket" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.protocol.PacketIn" title="mysql.connector.protocol.PacketIn"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.protocol.PacketIn</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.ErrorResultPacket">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">ErrorResultPacket</tt><big>(</big><em>buf=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.ErrorResultPacket" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.protocol.PacketIn" title="mysql.connector.protocol.PacketIn"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.protocol.PacketIn</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.FieldPacket">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">FieldPacket</tt><big>(</big><em>buf=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.FieldPacket" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.protocol.PacketIn" title="mysql.connector.protocol.PacketIn"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.protocol.PacketIn</span></tt></a></p>
<dl class="method">
<dt id="mysql.connector.protocol.FieldPacket.get_description">
<tt class="descname">get_description</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.FieldPacket.get_description" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a description as a list useful for cursors.</p>
<p>This function returns a list as defined in the Python Db API v2.0
specification.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.Handshake">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">Handshake</tt><big>(</big><em>buf=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.Handshake" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.protocol.PacketIn" title="mysql.connector.protocol.PacketIn"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.protocol.PacketIn</span></tt></a></p>
<dl class="method">
<dt id="mysql.connector.protocol.Handshake.get_dict">
<tt class="descname">get_dict</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.Handshake.get_dict" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.KillPacket">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">KillPacket</tt><big>(</big><em>arg</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.KillPacket" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.protocol.CommandPacket" title="mysql.connector.protocol.CommandPacket"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.protocol.CommandPacket</span></tt></a></p>
<dl class="method">
<dt id="mysql.connector.protocol.KillPacket.create">
<tt class="descname">create</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.KillPacket.create" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.KillPacket.set_argument">
<tt class="descname">set_argument</tt><big>(</big><em>arg</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.KillPacket.set_argument" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.MySQLProtocol">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">MySQLProtocol</tt><big>(</big><em>conn</em>, <em>handshake=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>Class handling the MySQL Protocol.</p>
<p>MySQL v4.1 Client/Server Protocol is currently supported.</p>
<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.cmd_change_user">
<tt class="descname">cmd_change_user</tt><big>(</big><em>username</em>, <em>password</em>, <em>database=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.cmd_change_user" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the user with given username and password to another optional database.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.cmd_debug">
<tt class="descname">cmd_debug</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.cmd_debug" title="Permalink to this definition">¶</a></dt>
<dd><p>Send DEBUG command to the MySQL Server</p>
<p>Needs SUPER privileges. The output will go to the MySQL server error log.</p>
<p>Returns True when it was succesful.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.cmd_init_db">
<tt class="descname">cmd_init_db</tt><big>(</big><em>database</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.cmd_init_db" title="Permalink to this definition">¶</a></dt>
<dd><p>Send command to server to change databases.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.cmd_ping">
<tt class="descname">cmd_ping</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.cmd_ping" title="Permalink to this definition">¶</a></dt>
<dd><p>Ping the MySQL server to check if the connection is still alive.</p>
<p>Returns True when alive, False when server doesn&#8217;t respond.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.cmd_process_info">
<tt class="descname">cmd_process_info</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.cmd_process_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the process list from the MySQL Server.</p>
<p>Returns a list of dictionaries which corresponds to the output of
SHOW PROCESSLIST of MySQL. The data is converted to Python types.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.cmd_process_kill">
<tt class="descname">cmd_process_kill</tt><big>(</big><em>mypid</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.cmd_process_kill" title="Permalink to this definition">¶</a></dt>
<dd><p>Kills a MySQL process using it&#8217;s ID.</p>
<p>The mypid must be an integer.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.cmd_query">
<tt class="descname">cmd_query</tt><big>(</big><em>query</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.cmd_query" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a query to the server.</p>
<p>Returns a tuple, when the query returns a result. The tuple
consist number of fields and a list containing their descriptions.
If the query doesn&#8217;t return a result set, the an OKResultPacket
will be returned.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.cmd_quit">
<tt class="descname">cmd_quit</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.cmd_quit" title="Permalink to this definition">¶</a></dt>
<dd><p>Closes the current connection with the server.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.cmd_refresh">
<tt class="descname">cmd_refresh</tt><big>(</big><em>opts</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.cmd_refresh" title="Permalink to this definition">¶</a></dt>
<dd><p>Send the Refresh command to the MySQL server.</p>
<p>The argument should be a bitwise value using the protocol.RefreshOption
constants.</p>
<p>Usage:</p>
<blockquote>
<div>RefreshOption = mysql.connector.RefreshOption
refresh = RefreshOption.LOG | RefreshOption.THREADS
db.cmd_refresh(refresh)</div></blockquote>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.cmd_shutdown">
<tt class="descname">cmd_shutdown</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.cmd_shutdown" title="Permalink to this definition">¶</a></dt>
<dd><p>Shuts down the MySQL Server.</p>
<p>Careful with this command if you have SUPER privileges! (Which your
scripts probably don&#8217;t need!)</p>
<p>Returns True if it succeeds.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.cmd_statistics">
<tt class="descname">cmd_statistics</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.cmd_statistics" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends statistics command to the MySQL Server</p>
<p>Returns a dictionary with various statistical information.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.do_auth">
<tt class="descname">do_auth</tt><big>(</big><em>username=None</em>, <em>password=None</em>, <em>database=None</em>, <em>client_flags=None</em>, <em>charset=33</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.do_auth" title="Permalink to this definition">¶</a></dt>
<dd><p>Make and send the authentication using information found in the
handshake packet.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.handle_handshake">
<tt class="descname">handle_handshake</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.handle_handshake" title="Permalink to this definition">¶</a></dt>
<dd><p>Check whether the buffer is a valid handshake. If it is, we set some
member variables for later usage. The handshake packet is returned for later
usuage, e.g. authentication.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.handle_header">
<tt class="descname">handle_header</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.handle_header" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes a buffer and readers information from header.</p>
<p>Returns a tuple (pktsize, pktnr)</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.is_eof">
<tt class="descname">is_eof</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.is_eof" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if the given buffer is a MySQL EOF Packet. It should
start with þ and be smaller 9 bytes.</p>
<p>Returns boolean.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.is_error">
<tt class="descname">is_error</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.is_error" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if the given buffer is a MySQL Error Packet.</p>
<p>Buffer should start with ÿ.</p>
<p>Returns boolean.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.is_ok">
<tt class="descname">is_ok</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.is_ok" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if the given buffer is a MySQL OK Packet. It should
start with .</p>
<p>Returns boolean.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.result_get_row">
<tt class="descname">result_get_row</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.result_get_row" title="Permalink to this definition">¶</a></dt>
<dd><p>Get data for 1 row</p>
<p>Get one row&#8217;s data. Should be called after getting the field
descriptions.</p>
<p>Returns a tuple with 2 elements: a row&#8217;s data and the
EOF packet.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.result_get_rows">
<tt class="descname">result_get_rows</tt><big>(</big><em>cnt=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.result_get_rows" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all rows</p>
<p>Returns a tuple with 2 elements: a list with all rows and
the EOF packet.</p>
</dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.MySQLProtocol.set_handshake">
<tt class="descname">set_handshake</tt><big>(</big><em>handshake</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.MySQLProtocol.set_handshake" title="Permalink to this definition">¶</a></dt>
<dd><p>Gather data from the given handshake.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.OKResultPacket">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">OKResultPacket</tt><big>(</big><em>buf=None</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.OKResultPacket" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.protocol.PacketIn" title="mysql.connector.protocol.PacketIn"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.protocol.PacketIn</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.PacketIn">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">PacketIn</tt><big>(</big><em>buf=None</em>, <em>pktnr=0</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.PacketIn" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.protocol.BasePacket" title="mysql.connector.protocol.BasePacket"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.protocol.BasePacket</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="mysql.connector.protocol.PacketOut">
<em class="property">class </em><tt class="descclassname">mysql.connector.protocol.</tt><tt class="descname">PacketOut</tt><big>(</big><em>buf=None</em>, <em>pktnr=0</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.PacketOut" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#mysql.connector.protocol.BasePacket" title="mysql.connector.protocol.BasePacket"><tt class="xref py py-class docutils literal"><span class="pre">mysql.connector.protocol.BasePacket</span></tt></a></p>
<p>Each packet type used in the MySQL Client Protocol is build on the Packet
class. It defines lots of useful functions for parsing and sending
data to and from the MySQL Server.</p>
<dl class="method">
<dt id="mysql.connector.protocol.PacketOut.add">
<tt class="descname">add</tt><big>(</big><em>s</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.PacketOut.add" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.PacketOut.add_1_int">
<tt class="descname">add_1_int</tt><big>(</big><em>i</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.PacketOut.add_1_int" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.PacketOut.add_2_int">
<tt class="descname">add_2_int</tt><big>(</big><em>i</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.PacketOut.add_2_int" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.PacketOut.add_3_int">
<tt class="descname">add_3_int</tt><big>(</big><em>i</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.PacketOut.add_3_int" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.PacketOut.add_4_int">
<tt class="descname">add_4_int</tt><big>(</big><em>i</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.PacketOut.add_4_int" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.PacketOut.add_null">
<tt class="descname">add_null</tt><big>(</big><em>nr=1</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.PacketOut.add_null" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.PacketOut.get">
<tt class="descname">get</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.PacketOut.get" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.PacketOut.get_header">
<tt class="descname">get_header</tt><big>(</big><big>)</big><a class="headerlink" href="#mysql.connector.protocol.PacketOut.get_header" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mysql.connector.protocol.PacketOut.set">
<tt class="descname">set</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.protocol.PacketOut.set" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-mysql.connector.utils">
<span id="utils-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">utils</span></tt> Module<a class="headerlink" href="#module-mysql.connector.utils" title="Permalink to this headline">¶</a></h2>
<p>Utilities</p>
<dl class="function">
<dt id="mysql.connector.utils.int1read">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">int1read</tt><big>(</big><em>c</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.int1read" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes a bytes and returns it was an integer.</p>
<p>Returns integer.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.int1store">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">int1store</tt><big>(</big><em>i</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.int1store" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes an unsigned byte (1 byte) and packs it as string.</p>
<p>Returns string.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.int2read">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">int2read</tt><big>(</big><em>s</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.int2read" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes a string of 2 bytes and unpacks it as unsigned integer.</p>
<p>Returns integer.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.int2store">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">int2store</tt><big>(</big><em>i</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.int2store" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes an unsigned short (2 bytes) and packs it as string.</p>
<p>Returns string.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.int3read">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">int3read</tt><big>(</big><em>s</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.int3read" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes a string of 3 bytes and unpacks it as integer.</p>
<p>Returns integer.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.int3store">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">int3store</tt><big>(</big><em>i</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.int3store" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes an unsigned integer (3 bytes) and packs it as string.</p>
<p>Returns string.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.int4read">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">int4read</tt><big>(</big><em>s</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.int4read" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes a string of 4 bytes and unpacks it as integer.</p>
<p>Returns integer.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.int4store">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">int4store</tt><big>(</big><em>i</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.int4store" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes an unsigned integer (4 bytes) and packs it as string.</p>
<p>Returns string.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.int8read">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">int8read</tt><big>(</big><em>s</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.int8read" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes a string of 8 bytes and unpacks it as integer.</p>
<p>Returns integer.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.intread">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">intread</tt><big>(</big><em>s</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.intread" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes a string and unpacks it as an integer.</p>
<p>This function uses int1read, int2read, int3read and int4read by
checking the length of the given string.</p>
<p>Returns integer.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.intstore">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">intstore</tt><big>(</big><em>i</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.intstore" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes an unsigned integers and packs it as a string.</p>
<p>This function uses int1store, int2store, int3store and
int4store depending on the integer value.</p>
<p>returns string.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.read_bytes">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">read_bytes</tt><big>(</big><em>buf</em>, <em>size</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.read_bytes" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads bytes from a buffer.</p>
<p>Returns a tuple with buffer less the read bytes, and the bytes.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.read_int">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">read_int</tt><big>(</big><em>buf</em>, <em>size</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.read_int" title="Permalink to this definition">¶</a></dt>
<dd><p>Take a buffer and reads an integer of a certain size (1 &lt;= size &lt;= 4).</p>
<p>Returns a tuple (truncated buffer, int)</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.read_lc_int">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">read_lc_int</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.read_lc_int" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes a buffer and reads an length code string from the start.</p>
<p>Returns a tuple with buffer less the integer and the integer read.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.read_lc_string">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">read_lc_string</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.read_lc_string" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes a buffer and reads a length coded string from the start.</p>
<p>This is how Length coded strings work</p>
<p>If the string is 250 bytes long or smaller, then it looks like this:</p>
<blockquote>
<div>&lt;&#8211; 1b  &#8211;&gt;
+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-
|  length  | a string goes here
+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div></blockquote>
<p>If the string is bigger than 250, then it looks like this:</p>
<blockquote>
<div><p>&lt;- 1b -&gt;&lt;- 2/3/4 -&gt;
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-
| type |  length   | a string goes here
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<dl class="docutils">
<dt>if type == ü:</dt>
<dd>length is code in next 2 bytes</dd>
<dt>elif type == ý:</dt>
<dd>length is code in next 3 bytes</dd>
<dt>elif type == þ:</dt>
<dd>length is code in next 4 bytes</dd>
</dl>
</div></blockquote>
<p>NULL has a special value. If the buffer starts with û then
it&#8217;s a NULL and we return None as value.</p>
<p>Returns a tuple (trucated buffer, string).</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.read_lc_string_list">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">read_lc_string_list</tt><big>(</big><em>buf</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.read_lc_string_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads all length encoded strings from the given buffer.</p>
<p>This is exact same function as read_lc_string() but duplicated
in hopes for performance gain when reading results.</p>
</dd></dl>

<dl class="function">
<dt id="mysql.connector.utils.read_string">
<tt class="descclassname">mysql.connector.utils.</tt><tt class="descname">read_string</tt><big>(</big><em>buf</em>, <em>end=None</em>, <em>size=None</em><big>)</big><a class="headerlink" href="#mysql.connector.utils.read_string" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads a string up until a character or for a given size.</p>
<p>Returns a tuple (trucated buffer, string).</p>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">connector Package</a><ul>
<li><a class="reference internal" href="#id1"><tt class="docutils literal"><span class="pre">connector</span></tt> Package</a></li>
<li><a class="reference internal" href="#module-mysql.connector._version"><tt class="docutils literal"><span class="pre">_version</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-mysql.connector.connection"><tt class="docutils literal"><span class="pre">connection</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-mysql.connector.constants"><tt class="docutils literal"><span class="pre">constants</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-mysql.connector.conversion"><tt class="docutils literal"><span class="pre">conversion</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-mysql.connector.cursor"><tt class="docutils literal"><span class="pre">cursor</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-mysql.connector.dbapi"><tt class="docutils literal"><span class="pre">dbapi</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-mysql.connector.errors"><tt class="docutils literal"><span class="pre">errors</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-mysql.connector.mysql"><tt class="docutils literal"><span class="pre">mysql</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-mysql.connector.protocol"><tt class="docutils literal"><span class="pre">protocol</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-mysql.connector.utils"><tt class="docutils literal"><span class="pre">utils</span></tt> Module</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="mysql.html"
                        title="previous chapter">mysql Package</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/mysql.connector.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="mysql.html" title="mysql Package"
             >previous</a> |</li>
        <li><a href="index.html">open-hea 0.1 documentation</a> &raquo;</li>
          <li><a href="mysql.html" >mysql Package</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2011, Tiwonge Manda, Brown Msiska, Evidence for Development.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>